Click here to Skip to main content
15,920,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to download data from the ftp server. Now issue is if I download small files eps or cdr then it work fine. If I download large files like 700mb 500mb then it not opening.
----Code------
C#
Response.AddHeader("content-disposition", "attachment; filename=" + filename + "");
WebClient request = new WebClient();
request.Credentials = new NetworkCredential(username, passwd);
string sSavePath = ftpServer + foldername + filename;
byte[] fileddat = request.DownloadData(sSavePath);
byte[] fileddat = request.DownloadData(sSavePath);
Response.BinaryWrite(fileddat);
Response.End();
Posted
Updated 3-May-10 20:25pm
v2

1 solution

Seema Gosain wrote:
If I download large files like 700mb 500mb then it not opening.

Have you set the HttpRuntime element with proper values in Web.Config file? For such big files it will take more time and thus you need to keep the request/response alive till then and also increase the size of request.

Read:
httpRuntime Element (ASP.NET Settings Schema)[^]

You would need to increase executionTimeout & maxRequestLength

Even after doing these, if there is some error/issue tell us what it is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900