wamania / ZipStreamedResponseBundle

A symfony Response to build and stream Zip on fly
11 stars 5 forks source link

ZIP file can't be open on OS X #1

Open xyNNN opened 8 years ago

xyNNN commented 8 years ago

When I implement the ZipStreamedResponse and return a ZipStreamer object I can't open the downloaded zip file on OS X, anyone have a solution for this?

bildschirmfoto 2016-05-13 um 22 11 02

danielmorgan commented 8 years ago

I think this might be file permission related. I can unzip archive.zip from the terminal, in which case I get this:

image

Changing the file permissions fixes it and lets me view the image normally.

chmod 644 unzipped-file.jpg

Not sure what's causing this or how to fix it though sorry.

xyNNN commented 8 years ago

Strange behaviour, but thanks for your time and investigation :)

wamania commented 8 years ago

Hello guys, Sorry, i just see this issue, i will try this on osx as soon as possible.

ghost commented 8 years ago

Hi, firstly congratulations for this pretty useful bundle !

I just have a problem when I zip my files. When I extract the zipped files, each file is locked.

The file doesn't has right access, and I need to chmod it to open it (I'm on Linux Ubuntu).

Do you have a solution to resolve this ?

Best regards,

André

PeterMagyar commented 6 years ago

I got the same.

chancegarcia commented 6 years ago

I'm receiving the same issue where the download zip file is not executable when downloaded. can open via command line. ended up having to use a different library and symfony StreamedResponse to have things work as expected.

Which is a shame because other than the permissions issue, this is everything I needed and would have saved the couple hours of searching/refactoring/learning that I had to do for an alternative.

Looked into things to try to help contribute a fix but think I need to understand zip file creation more to "see what the problem is". I'm sharing what I found here in case someone else is willing to figure out a solution as well.

I'm thinking the issue is somewhere in the central directory record (ZipStreamerBaseFile.php line 128ish) https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html#centraldirectory

if that's the case, then something in that record creation needs to be updated.

The only other thing I could find is maybe a temporary file needs to be created? https://customcreative.co.uk/avoiding-permissions-problems-creating-zip-files-php/

that link uses php's ZipArchive though so may not be relevant.

may the odds ever be in your favour

tiagofranco86 commented 5 years ago

Hello, I'm about to open the file for lack of permission. Any evolution? I'm running version 1.0

tiagofranco86 commented 5 years ago

Hello, Any evolution?