peter_anderson Posted March 21, 2010 Share Posted March 21, 2010 Hi there, I'm trying to allow my customers to download the files they have purchased. The file is store off the server (on most occasions), so $file is http://example.com/whatever.ext. Here's my code (unnecessary stuff cut) <?php // cut $file = $row2['file']; //header("Location: $file"); 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/force-download"); header("Content-Disposition: attachment; filename=\"$file\""); // cut ?> However, when I test it, .exe files don't register as exe's when they are downloaded (on my PC), so I think something is making the client download it as a different file type? Can anyone suggest how to fix it? Thanks Link to comment https://forums.phpfreaks.com/topic/196005-headers-downloading-exes/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.