使用html控件从客户端下载文件到服务器 [英] using html control to download file from client to server

查看:66
本文介绍了使用html控件从客户端下载文件到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用HtmlInputFile控件将文件从客户端上传到

服务器。我有一个浏览器在服务器上找到该文件,但是需要动态地创建

路径它是否会基于一些下拉框,一年

为年一个月。这行保存文件所以我正在尝试

从下拉框中获取月份和年份并将它们放入月份

和年份变量但这不起作用,

File1.PostedFile.SaveAs((" c:\\temp \\" +" \\" + month +" \\" +年+

Text1.Value))


这些是我必须获得所选月份和年份的两行但是

var month = month_dropdrown.selectedindex;

var year = year_dropdrown.selectedindex;

但我收到编译错误,month_dropdown未定义。我正在使用

javascript。

我也尝试使用alert()打印变量但是得到了编译器

错误,(未定义) 。

谢谢

-

Paul G

软件工程师。

Hi I am using the HtmlInputFile control to upload a file from a client to a
server. I have a browse to find the file on the server but need to create
the path dynamically as to were it will go based on some dropdown boxes, one
for the year and one for the month. This line saves the file so I am trying
to get the month and year from the dropdown boxes and put them in the month
and year variables but this does not work,
File1.PostedFile.SaveAs(("c:\\temp\\" + "\\" + month + "\\" + year +
Text1.Value))

These are the 2 lines I have to get the selected month and year but
var month=month_dropdrown.selectedindex;
var year=year_dropdrown.selectedindex;
but I get a compiler error, month_dropdown not defined. I am using
javascript.
I also tried printing out the variables using alert() but got a compiler
error, (not defined).
thanks
--
Paul G
Software engineer.

推荐答案

这些月份和年份JScript变量。


通常,您可以在服务器端脚本中编写上传功能。

形成路径和文件名的所有处理都需要在

服务器上完成。


如果你需要语法,请让我知道。


-

Ameet Phadnis

Sr.技术顾问

e Tek Global Inc 。

" Paul"写道:
Are these Month and Year JScript variables.

Typically, you would write the upload function in your server side script.
All the processing of forming the path and file name needs to be done on the
server.

If you need syntax for that please let me know.

--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
"Paul" wrote:

您好我正在使用HtmlInputFile控件将文件从客户端上传到

服务器。我有一个浏览器在服务器上找到该文件,但是需要动态地创建

路径它是否会基于一些下拉框,一年

为年一个月。这行保存文件所以我正在尝试

从下拉框中获取月份和年份并将它们放入月份

和年份变量但这不起作用,

File1.PostedFile.SaveAs((" c:\\temp \\" +" \\" + month +" \\" +年+

Text1.Value))


这些是我必须获得所选月份和年份的两行但是

var month = month_dropdrown.selectedindex;

var year = year_dropdrown.selectedindex;

但我收到编译错误,month_dropdown未定义。我正在使用

javascript。

我也尝试使用alert()打印变量但是得到了编译器

错误,(未定义) 。

谢谢

-

Paul G

软件工程师。
Hi I am using the HtmlInputFile control to upload a file from a client to a
server. I have a browse to find the file on the server but need to create
the path dynamically as to were it will go based on some dropdown boxes, one
for the year and one for the month. This line saves the file so I am trying
to get the month and year from the dropdown boxes and put them in the month
and year variables but this does not work,
File1.PostedFile.SaveAs(("c:\\temp\\" + "\\" + month + "\\" + year +
Text1.Value))

These are the 2 lines I have to get the selected month and year but
var month=month_dropdrown.selectedindex;
var year=year_dropdrown.selectedindex;
but I get a compiler error, month_dropdown not defined. I am using
javascript.
I also tried printing out the variables using alert() but got a compiler
error, (not defined).
thanks
--
Paul G
Software engineer.


嗨感谢您的回复。是的这些是jscript变量。是的,如果你

可以提供处理形成路径和文件名的语法(

需要在服务器上完成)。不是javascript在客户端上运行

机器吗?

再次感谢,

-

Paul G

软件工程师。

" Ameet Phadnis"写道:
hi thanks for the response. Yes these are jscript variables. Yes if you
could provide syntax for processing of forming the path and file name (that
needs to be done on the server). Doesn''t the javascript run on the client
machine?
thanks again,
--
Paul G
Software engineer.
"Ameet Phadnis" wrote:

这些月份和年份JScript变量。


通常,你会在服务器端编写上传功能脚本。

形成路径和文件名的所有处理都需要在

服务器上完成。


如果你需要语法请告诉我。


-

Ameet Phadnis

Sr.技术顾问
$ b $是Tek Global Inc.


" Paul"写道:
Are these Month and Year JScript variables.

Typically, you would write the upload function in your server side script.
All the processing of forming the path and file name needs to be done on the
server.

If you need syntax for that please let me know.

--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
"Paul" wrote:

您好我正在使用HtmlInputFile控件将文件从客户端上传到

服务器。我有一个浏览器在服务器上找到该文件,但是需要动态地创建

路径它是否会基于一些下拉框,一年

为年一个月。这行保存文件所以我正在尝试

从下拉框中获取月份和年份并将它们放入月份

和年份变量但这不起作用,

File1.PostedFile.SaveAs((" c:\\temp \\" +" \\" + month +" \\" +年+

Text1.Value))


这些是我必须获得所选月份和年份的两行但是

var month = month_dropdrown.selectedindex;

var year = year_dropdrown.selectedindex;

但我收到编译错误,month_dropdown未定义。我正在使用

javascript。

我也尝试使用alert()打印变量但是得到了编译器

错误,(未定义) 。

谢谢

-

Paul G

软件工程师。
Hi I am using the HtmlInputFile control to upload a file from a client to a
server. I have a browse to find the file on the server but need to create
the path dynamically as to were it will go based on some dropdown boxes, one
for the year and one for the month. This line saves the file so I am trying
to get the month and year from the dropdown boxes and put them in the month
and year variables but this does not work,
File1.PostedFile.SaveAs(("c:\\temp\\" + "\\" + month + "\\" + year +
Text1.Value))

These are the 2 lines I have to get the selected month and year but
var month=month_dropdrown.selectedindex;
var year=year_dropdrown.selectedindex;
but I get a compiler error, month_dropdown not defined. I am using
javascript.
I also tried printing out the variables using alert() but got a compiler
error, (not defined).
thanks
--
Paul G
Software engineer.


实际上我在服务器上运行脚本我认为,

< script language ="的javascript" runat =" server">

-

Paul G

软件工程师。

" Ameet Phadnis"写道:
actually I am running the script on the server I think,
<script language="javascript" runat="server">
--
Paul G
Software engineer.
"Ameet Phadnis" wrote:

这些月份和年份JScript变量。


通常,你会在服务器端编写上传功能脚本。

形成路径和文件名的所有处理都需要在

服务器上完成。


如果你需要语法请告诉我。


-

Ameet Phadnis

Sr.技术顾问
$ b $是Tek Global Inc.


" Paul"写道:
Are these Month and Year JScript variables.

Typically, you would write the upload function in your server side script.
All the processing of forming the path and file name needs to be done on the
server.

If you need syntax for that please let me know.

--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
"Paul" wrote:

您好我正在使用HtmlInputFile控件将文件从客户端上传到

服务器。我有一个浏览器在服务器上找到该文件,但是需要动态地创建

路径它是否会基于一些下拉框,一年

为年一个月。这行保存文件所以我正在尝试

从下拉框中获取月份和年份并将它们放入月份

和年份变量但这不起作用,

File1.PostedFile.SaveAs((" c:\\temp \\" +" \\" + month +" \\" +年+

Text1.Value))


这些是我必须获得所选月份和年份的两行但是

var month = month_dropdrown.selectedindex;

var year = year_dropdrown.selectedindex;

但我收到编译错误,month_dropdown未定义。我正在使用

javascript。

我也尝试使用alert()打印变量但是得到了编译器

错误,(未定义) 。

谢谢

-

Paul G

软件工程师。
Hi I am using the HtmlInputFile control to upload a file from a client to a
server. I have a browse to find the file on the server but need to create
the path dynamically as to were it will go based on some dropdown boxes, one
for the year and one for the month. This line saves the file so I am trying
to get the month and year from the dropdown boxes and put them in the month
and year variables but this does not work,
File1.PostedFile.SaveAs(("c:\\temp\\" + "\\" + month + "\\" + year +
Text1.Value))

These are the 2 lines I have to get the selected month and year but
var month=month_dropdrown.selectedindex;
var year=year_dropdrown.selectedindex;
but I get a compiler error, month_dropdown not defined. I am using
javascript.
I also tried printing out the variables using alert() but got a compiler
error, (not defined).
thanks
--
Paul G
Software engineer.


这篇关于使用html控件从客户端下载文件到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆