页面上的 input File 怎么取得文件的路径??
页面上有个HTML上传控件( <input id= "File1 " type= "file " /> ),怎么像FileUpload的FileUpload1.PostedFile.FileName
来取得上传文件的路径?谢谢
------解决方案--------------------用一个隐藏按钮把然后把File1.value赋值给它
------解决方案--------------------( <input id= "File1 " type= "file " runat= "server " /> ),
------解决方案--------------------用法与FileUpload差不多
.aspx:
<input id= "File1 " type= "file " runat= "server " />
.cs:
File1.PostedFile.FileName
------解决方案--------------------HttpFileCollection files = HttpContext.Current.Request.Files;
HttpPostedFile postedFile = files[0];
string path=postedFile.FileName