Reputation: 11
I'm having a problem allowing users to download items from the Sitecore media library, specifically.
I have a link to a media item (xls, pdf etc) on a page, when a user clicks on the page the file should be downloaded.
This works fine on our test sitecore instance, but when we try it on our live instance, the file starts to download OK but then seems to be truncated. (both instances are located on the same IIS server)
Using Fiddler, I can see that the downloads response body is truncated at 784kb.
HTTP/1.1 200 OK
Cache-Control: public, max-age=604800
Content-Type: application/vnd.ms-excel
Expires: Fri, 25 Mar 2011 14:12:48 GMT
Last-Modified: Fri, 18 Mar 2011 11:17:45 GMT
ETag: 050b2f8a408b47c49fefbe28b5ec9661
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET; Sitecore CMS
X-Powered-By: ASP.NET
Content-Disposition: attachment; filename="Filename.xls"
Date: Fri, 18 Mar 2011 14:12:48 GMT
Content-Length: 804795
(the file is actually 5019136kb!)
IF any body can shed any light, I'd be eternally grateful!
Yours in desperation!
Pete
--UPDATE--
Think I might be getting closer to the cause of this.
By closer examination of the response I'm getting back from the server
Response denied by WatchGuard HTTP proxy. Reason: chunk-size line too large line='‰u¯^%|\x0c\x04‡V–\x15ÿ\x00¾c*?Jã5]cW×o[R×5K›Ë‡ûóÝÎÒ;}Y‰&«Q]4èQ¥ðE/D‘ÅW\x13ˆ®ïRn^¿Ì(¢ŠÔÄ(¢Š\x00(¢Š\x00(¢Š\x00(¢¾…ý•?àœ¿\x1bi\x19'
Mystery 1 Solved - The reason it was working on the test site was because I wasn't going via the proxy server!
Mystery 2 - Why is the chunk size too large!!!!?
Pete
Upvotes: 1
Views: 2076
Reputation: 2395
The first thing I would check is the <httpRuntime maxRequestLength="" />
element/attribute in your web.config file. You'll want to ensure that the 'maxRequestLength' attribute value is set to a value large enough to accommodate the size of the files that you're serving.
Beyond that, are you generating the response headers yourself (i.e. in your code)? For instance, are you explicitly setting the Content-Disposition header and the Content-Length headers? If so, I would suggest verifying that the method you're using to compute the Content-Length is accurate.
Lastly, verify that the IIS configuration is the same between both Sitecore instances. Are you using IIS6, IIS7 or IIS7.5?
cheers, adam
Upvotes: 2
Reputation: 8778
Have you done a web.config comparison between the two instances?
Have you asked about this on the SDN forums?
This problem sounds so familiar. I'm sure that I've seen it before... Are you sure it's truncating the return? Or is it that there is 16kb of unwanted junk in the header/data? I want to say that's the issue I've seen before... but can't remember for sure. Brain cells are tingling, give me some time.
Upvotes: 0