EllisLab text mark
Advanced Search
     
Possible issue with Helper: Download
Posted: 26 September 2007 08:30 PM   [ Ignore ]
Joined: 2007-09-26
2 posts

I have successfully been using the force_download functionality, that is, until a client tried using it behind a firewall.

It seems the line:

header('Content-Type: "'.$mime.'"'); 

places a hex /x22 (or “) around the content type.  From the info I’ve received,  \x22application/octet-stream\x22 for example is not a valid type.  Changing lines (the code appears on lines 74 and 84 of download_helper.php) to:

header('Content-Type: '.$mime); 

fixed the problem.  Should this change be adopted in future releases?

 
Posted: 27 September 2007 05:38 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-23
3194 posts

Great find tmp.agent.  Thanks for this contribution.  I’ve recently (in the last 24 hours) been bitten by something that sounds strangely familiar to this.  I’m waiting on verification that your suggested change will impact things.

Do you have any references you could share with us - I’d be happy to committ this change if I could verify it was proper behaviour, and not just a buggy firewall.

Oh, and welcome to CI!

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 27 September 2007 08:05 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-09-26
2 posts

Here are some references:

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

See the section 14.17 Content-Type, you’ll notice that no ” characters are placed around the content type.

[2] http://au3.php.net/header

See ‘Example 1585. Download dialog’. Again no ” characters are placed around the content type.

[3] http://www.freesoft.org/CIE/RFC/1521/4.htm