Simmo
Simmo

Reputation: 1719

rubyzip error when generating zips of images on the fly : End-of-central-directory signature not found

I'm generating a zip file from a collection of images which is then sent to the user.

I'm using code which is almost exactly the same as the example given on this page;

http://info.michael-simons.eu/2008/01/21/using-rubyzip-to-create-zip-files-on-the-fly/

It works absolutely fine on my local development box, but when I run it on my staging server, I get a zero length zipfile which has the following error when I try to open it.

'End-of-central-directory signature not found'

Obviously it's hard to troubleshoot where I'm going wrong when it works fine on my development machine!

Cheers, Graeme

Upvotes: 2

Views: 2989

Answers (1)

Simmo
Simmo

Reputation: 1719

Got it!

It's because Rails 3 defaults to using x_sendfile, which the server isn't setup for.

Nothing to do with zips at all in the end, it's simply file sending. This post explains everything;

Rails sends 0 byte files using send_file

Upvotes: 4

Related Questions