如何减少bigexcel文件的上传时间 [英] how to reduce uploading time of a bigexcel file

查看:125
本文介绍了如何减少bigexcel文件的上传时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何减少大型Excel文件的上传时间

解决方案

上传时间取决于您的网速,如果是网络应用程序的话。



但您可以使用线程上传文件。因为线程是多任务概念,所以你可以使用它。它会让你觉得装载速度更快。



虽然你看到这个代码





 Stream writer = request.GetRequestStream(); 
byte [] bufferUploadSize = new byte [4096]; // ex。
FileStream fileStream = new FileStream(filePath,FileMode.Open,FileAccess.Read);
int bytesRead = 0;
while((bytesRead = fileStream.Read(bufferUploadSize,0,bufferUploadSize.Length))!= 0)
{
writer.Write(bufferUploadSize,0,bytesRead);
}
fileStream.Close();





并制作一个虚拟财产

 public virtual bool AllowWriteStreamBuffering {get;组; } 

为false,



你可以阅读msdn 链接


can anyone tell me about how to reduce uploading time of a big excel file

解决方案

The uploading time depends on your speed of net, if it is a webapplication.

But you can use threading for uploading file. because threading is multitasking concept, so you can use it. It will make you feel that the loading is faster.

though you see this code


Stream writer = request.GetRequestStream();
byte[] bufferUploadSize = new byte[4096];//ex.
FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
int bytesRead = 0;
while ((bytesRead = fileStream.Read(bufferUploadSize,0, bufferUploadSize.Length)) != 0)
{
    writer.Write(bufferUploadSize, 0, bytesRead);
}
fileStream.Close();



and make one virtual property

public virtual bool AllowWriteStreamBuffering { get; set; } 

to false,

you can read msdn link


这篇关于如何减少bigexcel文件的上传时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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