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.