473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

File download size limit

I have a site that allows a person to log in and get a list of files to
download for them. If the file size is under 65MB then everything is fine,
they click the download button and the save box pops up. But if the file is
larger than 65MB the page sits and processes until it times out. I can't
figure it out becaus a 64MB file loads immediately for download while one
slightly larger hangs up. Below is the code I am using for the download.
FileInfo targetFile = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
targetFile.Name);
Response.AddHeader("Content_Length", targetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(targetFile.FullName);
Response.End();
Any assistance on this will be greatly appreciated. Tim

Jul 8 '06 #1
2 3187
Thus wrote tjfdownsouth,
I have a site that allows a person to log in and get a list of files
to download for them. If the file size is under 65MB then everything
is fine, they click the download button and the save box pops up. But
if the file is larger than 65MB the page sits and processes until it
times out. I can't figure it out becaus a 64MB file loads immediately
for download while one slightly larger hangs up. Below is the code I
am using for the download.

FileInfo targetFile = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=" +
targetFile.Name);
Response.AddHeader("Content_Length",
targetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(targetFile.FullName);
Response.End();
Any assistance on this will be greatly appreciated. Tim
Try using Response.TransmitFile() instead of WriteFile(). TransmitFile()
doesn't buffer the file.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jul 9 '06 #2
That did the trick, Thanks
Tim

"Joerg Jooss" wrote:
Thus wrote tjfdownsouth,
I have a site that allows a person to log in and get a list of files
to download for them. If the file size is under 65MB then everything
is fine, they click the download button and the save box pops up. But
if the file is larger than 65MB the page sits and processes until it
times out. I can't figure it out becaus a 64MB file loads immediately
for download while one slightly larger hangs up. Below is the code I
am using for the download.

FileInfo targetFile = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=" +
targetFile.Name);
Response.AddHeader("Content_Length",
targetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(targetFile.FullName);
Response.End();
Any assistance on this will be greatly appreciated. Tim

Try using Response.TransmitFile() instead of WriteFile(). TransmitFile()
doesn't buffer the file.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jul 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PeterB | last post by:
Hi! I am using the script below to download files, that are in a non-public directory, from my site. The "smaller files" section works for smaller files. However when the files are getting...
6
by: Paul | last post by:
Hi there, When adding a "File Field" HTML control to an aspx page to facilitate file uploading, the following occurs: 1. You select a file that is larger than the allowed size limit. 2. Once...
22
by: petermichaux | last post by:
Hi, I'm curious about server load and download time if I use one big javascript file or break it into several smaller ones. Which is better? (Please think of this as the first time the scripts...
4
by: tjfdownsouth | last post by:
I have a site that allows a person to log in and get a list of files to download for them. If the file size is under 65MB then everything is fine, they click the download button and the save box...
5
by: Jefferis NoSpamme | last post by:
Hi all, I'm trying to limit the file size of an image submission and I keep running into various problems. I've got most of it working, but I'm stumped and I have a basic question as to WHY this...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
0
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
14
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.