473,379 Members | 1,270 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,379 software developers and data experts.

Downloading 200MB+ files and errors in .NET

I am using Forms Authentication to force a login to a support folder,
where there are large .exe and .zip files for download. In my
web.config file, i am blocking these file extensions with a
httpHandler

<httpHandlers>
<add verb="*" path="*.exe" type="MyHandler.NewHandler,httpHandler"/>
<add verb="*" path="*.zip" type="MyHandler.NewHandler,httpHandler"/>
</httpHandlers>

The code that downloads the files in the handler is...

string strFileName =
context.Request.MapPath(context.Request.ServerVari ables["PATH_INFO"]);
FileInfo myFile = new FileInfo(strFileName);
objResponse.AddHeader("Content-Disposition","attachment; filename=" +
myFile.Name);
objResponse.ContentType = "application/octet-stream";
objResponse.TransmitFile(myFile.Name);
objResponse.Flush();
objResponse.End();

My problem is that when you are downloading a file, part way through
an error message appears saying, "The connection with the server has
been reset" or the file will seem to have downloaded correct, but only
40 or 50 mb's have been downloaded.

I thought it may be a timeout issue, so i made this change to the
web.config file... nothing changed though.

<system.web>
<httpRuntime executionTimeout="36000" />
</system.web>
Nov 18 '05 #1
3 1352
Check this article:
http://support.microsoft.com/default...Product=aspnet

Anyways, I tried the code they provided and I didn't like it. Basically, it
will host up the server into a very long loop if the client clicked Cancel
but didn't close the browser.

Hope that helps..

Nov 18 '05 #2
Thanks for the reply... but we already tried that way. Instead of
Response.WriteFile we are using Response.TransmitFile which just became
available several weeks ago.

Any other thoughts?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
> Any other thoughts?

You might be interested in this article:
http://www.devx.com/dotnet/Article/22533

It provides a way of downloading a file chunk-wise, AND being enabling your
application to resume broken downloads.


Nov 18 '05 #4

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

Similar topics

4
by: Luke StClair | last post by:
Only marginally belonging in this newsgroup... but oh well. I've just started writing in python, and I want to make the files available on the web. So I did the standard <a...
2
by: Bala | last post by:
Hi I am trying to download the PDF files from my webserver using ASP.Net. All my files are stored at F Drive on webserver. Like this F:\Main Folder\Sub Folder\Files\File1.pdf I am...
1
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call...
0
by: just.starting | last post by:
I am having problem while downloading files from an apache server2.0.53 with php4.3.10.While downloading some files it generally stops after downloading some specific amount and then stops...
0
by: Frank Rizzo | last post by:
Hello, I've deployed a SmartClient/ClickOnce app to a web server. For whatever reason, for some users the application doesn't fully download. Instead the progress bar is stuck at 5 or 10%. After...
6
by: justsee | last post by:
Hi, I'm using Python 2.3 on Windows for the first time, and am doing something wrong in using urllib to retrieve images from urls embedded in a csv file. If I explicitly specify a url and image...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
7
by: Ehsan | last post by:
I foundd this code in ASPN Python Cookbook for downloading files in python but when it finished downloading files the files became corrupted and didn't open, the files in internet havn't any...
4
by: ian.tiesdell | last post by:
Hi I have a database which has linked tables, none stored locally - it has a size when compacted of nearly 200Mb it comprises 21 queries, 26 forms and 2 reports - there are no embedded images...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.