Add content length to downloads

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
8/15/2007 1:37:07 PM
Gravatar
Total Posts 80

Add content length to downloads

Joe,

Add the below code to SharedFilesDownload.aspx to include the content length in the http response. This allows the webbrowser to show a progress bar while downloading the file.

string downloadPath = Page.Server.MapPath(WebUtils.GetApplicationRoot()
+ "/Data/Sites/" + this.CurrentPage.SiteID.ToString() + "/SharedFiles/")
+ sharedFile.ServerFileName;
System.IO.FileInfo fileInfo = new System.IO.FileInfo(downloadPath);
string fileLength = fileInfo.Length.ToString();
Page.Response.AppendHeader("Content-Length", fileLength);

-Jesse

 

8/15/2007 1:55:24 PM
Gravatar
Total Posts 18439

Re: Add content length to downloads

Will do.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.