Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Ayende Rahien 8/11/2005 2:46 PM
I'm getting a lot of reports about problems with the download module.
The problem seems to be that some people get most of the way and then it just stops.
Any idea why?
The problem is on this page:
http://www.ayende.com/projects/nhiberante-query-analyzer/downloads.aspx

of course, it's working just fine to me :-((brb)
# big_al 8/11/2005 5:29 PM
Tried download the NHQA 0.9 and it hung at 97% ...

Have you tried monitoring your application, or app restarts?

# martijnb 8/12/2005 12:27 PM
To be honest, I have no idea why this problem occurs. Maybe a request timeout during downloading? From the Cuyahoga site stats I've noticed that sometimes at some point in time the number of downloads files increases spectaculary (happened 1 time this month). Perhaps the somebody who experienced the same problem and tried to download again and again.

# Ayende Rahien 8/27/2005 11:03 AM
Martin, due to this problem, I made the following changes to the downloads module:

* Changed DownloadCurrentFile() to just do a Response.Redirect() to the file.
* Because I needed a http path for this, I changed downloads module to not use server.MapPath()

This works on my server, but it would probably needs more polish for public consumtion.
# martijnb 9/4/2005 8:20 AM
A redirect might be fine for files that are publicly available, but we can't use it in scenarios where only authenticated users can download specific files.

The problem with the downloads is probably recycling of the ASP.NET process during download. Currently the entire file is loaded in memory (Response.WriteFile) and with simultaneous downloads this can result in recycling.
I'll try to fix it with streaming smaller chunks to the client.
# martijnb 9/4/2005 10:13 AM (edited 9/4/2005 10:14 AM)
See JIRA

A fix is in SVN now (Downloads.ascx.cs). Ayende, could you give this one a try?
# Ayende Rahien 3/16/2007 7:10 AM
I just run into this again, in Cuyahoga 1.5, I changed the code in Downloads.ascx.cs to :
private void DownloadCurrentFile()
{
	Domain.File file = this._downloadsModule.GetFileById(this._downloadsModule.CurrentFileId);
	base.Response.ContentType = file.ContentType;
	base.Response.AppendHeader("Content-Disposition", "attachment; filename=" + file.FilePath);
	Response.WriteFile(System.IO.Path.Combine(_downloadsModule.FileDir, file.FilePath));
	this._downloadsModule.IncreaseNrOfDownloads(file);
}
# martijnb 3/18/2007 1:09 PM
Hmm, strange, the code that streams the file to the client hasn't really changed for 1.5. Can you describe the exact issue? Just timeouts?

The solution with Response.WriteFile will definitely give memory issues under high load with large files. People say that Response.TransmitFile can solve this, although, I haven't tried it myself.
# Ayende Rahien 3/29/2007 1:48 AM (edited 3/29/2007 1:50 AM)
Sorry, I posted to the wrong thread