How to efficiently send large files from a database to a browser?

In my web application, I work with files. Some files are very large. I use Response.Write()to write a file to the browser. This is suitable for small files, but for large files it may take some time and the bandwidth is fully utilized.

Is it possible to split large documents and send them in parts to the browser? Are there other ways to send a document to the browser faster?

I store the document as a property of the object.

+3
source share
6 answers

Why don't you compress the file and store it in the database and unpack it?

Depending on these issues, you can do a lot:

  • How often does the file change?

  • ?

  • DB ?

, , , , AJAX . WebHandler.ashx.

:

http://www.dotnetcurry.com/ShowArticle.aspx?ID=193&AspxAutoDetectCookieSupport=1

http://www.viawindowslive.com/Articles/VirtualEarth/InvokingserversidecodeusingAJAX.aspx

+2

: ?

, . - excel doc .., (), . , .

+1

, , " " . , .

( , .mht, ), , . , , , .

, , , . , .

+1

IIS. , , .

+1

ASP.NET, FileStream - .

0

Flush , , ().

, , aptly .

I thought about using it myself, the project sent documents that became quite large, and I was careful about storing all the data in memory. In the end, I decided that the data was not big enough to be a problem.

Unfortunately, the MSDN documentation is very, very vague as to what Flush implies, and you may have to use Google to troubleshoot.

0
source

Source: https://habr.com/ru/post/1747996/


All Articles