Are you sure Safari isn't automatically *unzipping* the file for you?
http://www.giantrobot.co.nz/tmp/getzip.phps < your code
http://www.giantrobot.co.nz/tmp/getzip.php < works
I tested this out, but my test zip contained only getfile.php - so I
didn't spot that it was an auto-/unzip/ until I changed the contents of
the zipfile to getfile.phps ... and Safari started saving that to disk
instead.
Does that fix it for you?
matt_thomson wrote:
> Hi I have a simple script to download some files from behind my web
> root, it goes like this:
>
> header('Content-type: application/zip');
> header('Content-Disposition: attachment; filename="zipfile.zip"');
> readfile('home/matts_server/downloads/zipfile.zip');
>
> This is straight out of the PHP manual:
> http://nz.php.net/manual/en/function.header.php (example 1)
>
> This works fine in IE/Firefox, but Safari ignores the application/zip
> and appends a .html extension on to the end of the file. This happens
> on a Mac and on Windows.
>
> Apple are not being very helpful:
> http://support.apple.com/kb/TA24293?viewlocale=en_US&locale=en_AU
>
> And it seems others are having the same problem:
> http://forums.macrumors.com/archive/index.php/t-167086.html
>
> Thanks,
> Matt.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---