What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP & IE using headers to add file as an attachment...

PHP & IE using headers to add file as an attachment...
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
O.P. PHP & IE using headers to add file as an attachment...
Ok so I have a situation and it is confusing me as this works fine in Firefox.

PHP code:
<?
    $path = '/home/ss/plsc/';
    $f = scandir( $path );
    rsort ( $f );
 
    $file = '/home/ss/plsc/'.$f[0];
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: public");
    header("Content-Description: File Transfer");
    header("Content-Type: application/zip");
    header("Content-Disposition: attachment; filename=\"".basename($file)."\"");
    header("Content-Transfer-Encoding: binary");
    header('Content-Length: ' . filesize($file));
    readfile($file);
?>


I have the above code. This simply grabs the last PLSC built on the server for download. There are no problems at all in Firefox. However in IE you end up with a PLSC that inside has the PLSC again without an extension... I also added the mime type using .htaccess

[Image: attachment.php?pid=984168]

I am at a loss...

.jpg File Attachment: ie_downloaded_plsc.jpg (57.74 KB)
This file has been downloaded 224 time(s).

This post was edited on 01-08-2010 at 04:18 PM by matty.
01-08-2010 04:07 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP & IE using headers to add file as an attachment... - by matty on 01-08-2010 at 04:07 PM
RE: PHP & IE using headers to add file as an attachment... - by Mnjul on 01-08-2010 at 04:18 PM
RE: PHP & IE using headers to add file as an attachment... - by matty on 01-08-2010 at 04:22 PM
RE: PHP & IE using headers to add file as an attachment... - by Mnjul on 01-08-2010 at 04:34 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On