Support for Upload/Download for large file sizes - Sharing Solution

This post has 6 Replies | 5 Followers

Not Ranked
Posts 41
Points 700
Wayne Bynum Posted: Mon, Mar 19 2007 4:53 PM

We are using CS in our enterprise to host some large files (e.g. > 20 mb) and kept having trouble with CS failing during both upload and/or download of these files.  I did some online research after adjusting every possible timeout and runtime settings in IIS and CS and I came up with the following solution in the CS_2.1.60809.935_SDK that solved the problem. 

  • File: Compoonents/Configuration/AttachmentSettings.cs
    • Line 400: cntx.Response.WriteFile(name) changed to cntx.Response.TransmitFile(name) ... TransmitFile avoids loading the entire file into memory
    • Line 476: disposition = "inline" changed to disposition = "attachment" ... this changes all attahments to be handled as attachments by browsers

 Here are other changes made as well that I made that you may or may not need to make:

  • File: Web/web.config
    • added <httpRuntime executionTimeout="220" maxRequestLength="50000" /> ... inside of <system.web> area
  • File: Web/ControlPanel/FileAdmin\FolderOptionControl.ascx.cs (this one is for individual file galleries)
    • added f.isSearchable = false; and f.EnableExternalLinks = false; inside if(isNew) { f = new Folder(); ... at line 89
  • File: Web/ControlPanel/FileAdmin\FolderEditControlDetails.ascx.cs (this one is for individual file galleries)
    • added f.isSearchable = false; and f.EnableExternalLinks = false; inside if(isNew) { f = new Folder(); ... at line 138

With these changes I can support upload and download of files up to the size defined in the maxRequestLength without any unexpected results for the File Galleries application.  I am not sure all of these changes are required, but I wanted to give the CS folks something to start with since I haven't seen this solution anywhere else in the community.

Wayne Bynum Application Developer
Not Ranked
Posts 13
Points 140

Many thanks! I'll try it on my cs!Yes

  • | Post Points: 5
Not Ranked
Posts 41
Points 700

We are upgrading to CS2007 and we noticed the bug was still there for uploading attachments / files that are larger than 20mb.  The following changes were made in the SDK to upload files up to 90mb.

Add the following to web.config inside the <system.web> section to keep IIS from timing out for 5 minutes and allowing for large file support to 90mb:

<httpRuntime executionTimeout="300" maxRequestLength="90000" />

Change line 320 of \source\Components\Configuration\AttachmentSettings.cs from

cntx.Response.WriteFile(name); TO cntx.Response.TransmitFile(name);

TransmitFile doens't load the entire file in memory before transmitting ... here is a reference http://blogs.msdn.com/irenak/archive/2006/04/12/574936.aspx.

Wayne Bynum Application Developer
Top 75 Contributor
Posts 294
Points 4,195

Thanks a lot for this. Exactly what I needed.

  • | Post Points: 20
Not Ranked
Male
Posts 23
Points 340

Hello,

I have CS2007 installed and files over 25 MB cannot be downloaded. IE goes to blank page. 

Stupid question, how do I integrate your suggested changes? I unzipped the SDK to ../Program Files/...

I can alter the lines you describe but I still get the download error. I have been trying to cure this for a few weeks now any advice will helpful

Many thanks, Jurgen 

Not Ranked
Posts 41
Points 700

You have to compile the SDK using Visual Studio then copy the dll files from the bin directory over to your installation bin directory .... if you don't know what I am talking about then STOP and find an experienced developer to help you so you don't make any unintentional mistakes.

Good luck Yes

Wayne Bynum Application Developer
  • | Post Points: 20
Not Ranked
Male
Posts 23
Points 340

ok, gotcha. I haven't changed any application sources code as of yet. I created a custom theme. Any chance I can copy someones correct DLL? (to save myself time in VS2005).
I hope Telligent will fix this bug. There are more reports out there that folks can't download large files.
I can upload no problem, because I added a line to the web.config file.

Many thanks, Jurgen

Page 1 of 1 (7 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com