[Mongrel] send_file and ZIP files

joost baaij joost at spacebabies.nl
Tue Feb 27 07:58:17 EST 2007


Your production Mongrel is generating an error (500 Internal Server  
Error).
Check your log/production.log where the error will be printed.

Op 27-feb-2007, om 10:05 heeft Niall O Broin het volgende geschreven:

> I have an application which uses send_file to send a ZIP file to the
> client. This works nicely when it's run on our development OS-X
> boxes, using mongrel from script/server, but on our production
> server, using mongrel behind Apache 2.2. with mod_proxy_balancer, the
> client gets 1 byte delivered :-(
>
> If I use wget -S to the URL in order to see the full headers I see
> this on production
>
> HTTP request sent, awaiting response...
>    HTTP/1.1 500 Internal Server Error
>    Date: Tue, 27 Feb 2007 08:52:54 GMT
>    Server: Mongrel 1.0.1
>    Status: 500 Error
>    Content-Transfer-Encoding: binary
>    Cache-Control: private
>    Content-Disposition: attachment; filename="somefile.zip"
>    Content-Type: */*
>    Content-Length: 1
>    Set-Cookie: _my_session_id=a65e09ab923208a4404893f2d3709196; path=/
>    Via: 1.0 www.myhost.com
>    Connection: close
> 08:52:54 ERROR 500: Internal Server Error.
>
> whereas on the development servers I see
>
> HTTP request sent, awaiting response...
>    HTTP/1.1 200 OK
>    Connection: close
>    Date: Tue, 27 Feb 2007 08:55:40 GMT
>    Set-Cookie: _my_session_id=e8e877a3c0ae65386306e745df50b124; path=/
>    Status: 200 OK
>    Content-Transfer-Encoding: binary
>    Cache-Control: private
>    Content-Disposition: attachment; filename="somefile.zip"
>    Server: Mongrel 1.0.1
>    Content-Type: application/zip
>    Content-Length: 3698448
> Length: 3,698,448 (3.5M) [application/zip]
>
> I rather suspect that the problem may be related to the  Content-
> Type:  header which is correctly set on the development box, but yet
> is set to */* for some reason on production.
>
> The code which is called is this
>
> send_file @tour.zip_files, :filename => "#
> {@tour.filename}.zip", :type => 'application/zip'
>
> where @tour.zip_files is a method which writes the ZIP file, and
> returns a path to it. This is working on the production box, insofar
> as it does write the ZIP files.
>
> A smaller problem, though it will be an issue in production, is that
> the filename saved was not the filename specified in the  Content-
> Disposition  but rather the filename in the URL which is something
> different.
>
>
>
> Kindest regards,
>
>
>
> Niall  O Broin
>
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users

-- 
www.gomagazine.nl +31643904460 pobox 51059 nl-1007eb amsterdam


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2423 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070227/3635a6d5/attachment.bin 


More information about the Mongrel-users mailing list