Can anyone help me figure out why when I download a zip file with headers in php it is invalid? The file opens fine on my server but when I test my download code and save the file to my desktop it says it is invalid. What could be causing this? Here is the code I am using to download the zip file:
When I remove the ob_clean() it works. I am a little new to php so does that function have any security issues I should be concerned about? Also, is there something that would cause the rest of the page to not be output after the readfile()? For some reason the download is working fine but the message and footer I have placed on the page after the headers are not being output. The exit function in the above code is moved down after the message and footer.
10-07-2012, 11:01 AM
tommy268
In your case following program method must be useful Fix zip file tool may restore your zip archives in cases: ZIP file you have been downloading for so long is broken, corrupt and cannot be opened and others.
10-08-2012, 04:28 AM
ZABI
try to move ob_clean() and flush() before the first header. i think your file is output empty.