Welcome Guest, Not a member yet? Register   Sign In
CI generated zip-files are corruped and unpackable. Please help!
#1

[eluser]murphy2006[/eluser]
Hello!

I am trying to zip a folder containing four doc files using the native CI zip library.
The zipping works fine and I get a file called folder.zip. The problem is that when I try to unzip it both the build in unzipper in Windows and WinRar says that it is corruped and cannot be unpacked.

I am using the code as the CI manual states. Does anyone know how to fix it.

Thanks!
#2

[eluser]thdls55[/eluser]
Since you are not able to open the file, you don't really know if zipping has worked.

Whatever output is being sent to the browser, it appears to be a "zip file" because of the content-type/disposition HTTP headers used. In reality, it may just consist of error messages, or other HTML or text content.

To debug the problem, you can try opening the file with a text editor (maybe after renaming from .zip to .txt)
#3

[eluser]murphy2006[/eluser]
Thanks for the quick reply!

I think I have fixed the problem now. The only thing I did was to move the force download function to its own function within the controller and now it works fine.

The current problem now is that I get the complete folder structure replicated within the Zip-file now, ie instead of just getting the three files I want I get the tree too:

files/notes/content/

Anyone knows how to fix this?




Theme © iAndrew 2016 - Forum software by © MyBB