因为我只需要文件路径,而不上传文件!

解决方案 »

  1.   

    那你就不用
    SaveAs()保存就等于不上传了呀。
      

  2.   

    不是这个意思,我用socket,ftp协议上传,因为filefield控件不能上传大文件,但我要用filefield控件获取文件路径,如果文件太大,该页面就不能postback,后台代码是无法执行的,也就获取不了文件名。我希望在该页面表单提交时,不将选择的文件流postback,而只有文件名就行!
      

  3.   

    <input type="hidden" id="hid" name="hid" runat="server">
    <input type="file" onchange="document.all.hid.value=this.value" id="file1" name="file1">
     后台直接取hid这个htmlinputhidden的Value
      

  4.   

    不要用runat=server在服务器段use
    Request["fileid"]
      

  5.   

    在页面上这样写
    <form id="Form1" method="post" runat="server">
    <INPUT id="file1" type="file" name="file1">
    <asp:button id="Button1" runat="server" Text="Button"></asp:button>
    </form>后台代码这样取
    this.Response.Write(this.Request.Form["file1"]);