473,397 Members | 2,077 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,397 software developers and data experts.

File Download Problem

Tim
I have developed a web based file manager application. It has a simple
interface that allows users to upload and download files. Everything works
great except for one new download problem. I am forcing the file download in
the following code:

Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Length", myFile.Length.ToString())
Response.AppendHeader("content-disposition", "attachment; filename="
+ System.IO.Path.GetFileName(PhysFilePath))
Response.WriteFile(PhysFilePath)
Response.End()

The problem occurs when the file size gets to be over 64 MB. If the file
size is under 64 MB, it works great and immediately prompts with the download
dialog. When the file is over 64 MB the page just hangs and nothing happens.
Does anyone know what might be causing this problem? Is it a code issue or
something with the server/iis (server is W2K3, IIS 6)?

Thanks,
Tim

Mar 8 '06 #1
2 1997
I think there is a default max length. I forget what that length is but I
think you can override that setting by using IIS5 uses <httpRuntime
maxRequestLength="NEWLENGTH" />

IIS6 uses MaxRequestEntityAllowed see
http://msdn.microsoft.com/library/de...21465da1bf.asp

HTH,
Tony Merante

"Tim" <Ti*@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.com...
I have developed a web based file manager application. It has a simple
interface that allows users to upload and download files. Everything works
great except for one new download problem. I am forcing the file download
in
the following code:

Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Length", myFile.Length.ToString())
Response.AppendHeader("content-disposition", "attachment;
filename="
+ System.IO.Path.GetFileName(PhysFilePath))
Response.WriteFile(PhysFilePath)
Response.End()

The problem occurs when the file size gets to be over 64 MB. If the file
size is under 64 MB, it works great and immediately prompts with the
download
dialog. When the file is over 64 MB the page just hangs and nothing
happens.
Does anyone know what might be causing this problem? Is it a code issue or
something with the server/iis (server is W2K3, IIS 6)?

Thanks,
Tim

Mar 9 '06 #2
Tim
Thank you for your response.

I am using IIS 6. I set the following under IIsWebService:

AspMaxRequestEntityAllowed="4294967295"
MaxRequestEntityAllowed="4294967295"

I then re-started IIS, but I am still having the same problem.

I'm really at a loss here. I believe it has to be a server setting, but I
can't find where. Any help here would be greatly appreciated!

Thanks,
Tim
Mar 9 '06 #3

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

Similar topics

5
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily...
1
by: ASP Spam Fighter | last post by:
Hello all, I don't know how to get around this one... If anybody can help me with this problem, I would appreciate it very much. I've been trying to send a (large) file to the browser via a...
3
by: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
2
by: Andrew Jocelyn | last post by:
Hi I get this error when I change something in the web.config file. When I build the VS projects and load the first web page the application runs fine. If I then make a save the web.config file...
6
by: rony_16 | last post by:
Hi, I have problem with downloading a file using WebRequest and HttpWebResponse. Inorder to download this file i need to call to url that tells to prepare the file for download, and then i call...
3
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. ...
4
by: pradqdo | last post by:
Hi folks, I have a very strange problem when I try to port my client/server program to cygwin. It is a simple shell program where the server executes client's commands + it can send and receive...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.