473,795 Members | 3,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Conten tType = "applicatio n/octet-stream"
Response.Append Header("Content-Length", myFile.Length.T oString())
Response.Append Header("content-disposition", "attachment ; filename="
+ System.IO.Path. GetFileName(Phy sFilePath))
Response.WriteF ile(PhysFilePat h)
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 2017
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
maxRequestLengt h="NEWLENGTH" />

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

HTH,
Tony Merante

"Tim" <Ti*@discussion s.microsoft.com > wrote in message
news:1E******** *************** ***********@mic rosoft.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.Conten tType = "applicatio n/octet-stream"
Response.Append Header("Content-Length", myFile.Length.T oString())
Response.Append Header("content-disposition", "attachment ;
filename="
+ System.IO.Path. GetFileName(Phy sFilePath))
Response.WriteF ile(PhysFilePat h)
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:

AspMaxRequestEn tityAllowed="42 94967295"
MaxRequestEntit yAllowed="42949 67295"

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
6129
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 downloads. It uses fpassthru() and some headers() to send a file to the requesting user. The get.php file that I wrote (the file download module if you will) works like a charm for .ZIP files and .TXT files. However, when .EXE files are downloaded...
1
3231
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 download page that uses a file download component. The file downloads fine, except that Internet Explorer refuses to browse to a different page while the file is downloading! I don't understand why it does that and I don't know how to fix this...
3
12181
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 lot of information, but if you need more (e.g. the code) please write michael@mblarsen.dk. The problem is this error messages (the code is build just fine; no errors):
1
5401
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 completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
2
1663
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 = MapPath(e.CommandArgument as string); // Name of file is passed in cmd arg.
2
1766
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 I then get this error when I refresh the browser. I have to restart IIS to fix the problem. I've included the error info but it all looks very cryptic to me. How do I find out what's really happening and how to fix it? Thanks
6
414
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 to another url that downloads the file. I have a problem with that because: 1. i do not know when the server finished the preparetion. 2.i checked the HttpStatusCode but he doen't changes
3
2142
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. The problem is that when you run the program it gets to the: Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name)
4
5709
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 files (something like ftp server/client). I implemented all the commands which the server executes from scratch meaning I don't use fork and exec. It was very educational but my problem is that when I try to "get <filename>" from server to the...
1
47492
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.