直接用http的post将文件字节写入。
参考这个。http://hi.baidu.com/netpet/blog/item/423007faa0867f9058ee90c4.html

解决方案 »

  1.   

    FileUpload上传同时不能提交数据,改用HtmlInputFile,HtmlInputButton 其实现例子: http://www.codeproject.com/KB/aspnet/multiuploads.aspx
      

  2.   

    post 上传或用webclient上传
    <form method="post" enctype="multipart/form-data" action="upload.aspx">
    <input name="MyUpFile" type="file" id="MyUpFile">
    <input type="submit" name="Submit" value="提交">
    </form>
    upload.aspx 
    if (Request.Files.Count != 0){ 
        HttpPostedFile MyUpFile = Request.Files["MyUpFile"]; 
        MyUpFile.SaveAs(Server.MapPath("") + MyUpFile.FileName.Remove(0, MyUpFile.FileName.LastIndexOf("\\"))); 
    }
    参考
      

  3.   


    这种post文件还是通过request.inputstream来获得,我看文件名是通过querystring的方式传的。querystring有大小限制,感觉也不是很好
      

  4.   


    用WebClient我试了一下
            System.Net.WebClient client = new System.Net.WebClient();
            System.Text.UTF8Encoding convert = new System.Text.UTF8Encoding();
            client.QueryString.Add("par1", "asdffasdF");
            client.QueryString.Add("par2", "asdffasdF");      
            client.Headers.Add("par2", "<xml>asdfasdlfaskldfjklasdjflkasjdfklasjdfkljasdklfjk</xml>");
            client.UploadFile("http://localhost:17410/test.aspx", "POST", "C:\\ai.mp3");
    这种方式querystring和header都可以传递数据,现在就是想问问大家通过哪种方式最好