0

我可以使用另一种方法来在上传文件期间获取“写入的字节数”或类似的东西吗?我想要一个进度,这是写入数据的实际进度,还是使用此类和方法不可能?如果没有,要研究的路线是什么?

谢谢。

基本示例:

if(FileUpload1.HasFile)
{
  savePath += FileUplaod1.FileName;
  FileUpload1.SaveAs(savePath); ///  Here is where I want to do a stream or some way to grab
   //bytes written so I can do an async on it and show the progress, not wait until it is copleted, and then show a label status of "completed". Doing this for a form that has to be non-html5 compatibale. That is why I am not using a different method.  

}
4

2 回答 2

1

HttpPostedFile 文件 = context.Request.Files["userfile"]; 文件.内容长度;

于 2013-11-07T15:16:23.090 回答
0

我得到了它。昨晚起得这么晚,完全忽略了这一点。

bytes[] filebytes = UplaodFile1.FileBytes ;
//Now I can send to stream.....   
于 2013-11-07T14:50:00.870 回答