c_shelswell Posted February 28, 2008 Share Posted February 28, 2008 Hi, I'm trying to get a page to work to download a file using the header function. It works great if you just click the link but if you right click 'save target as' (only in firefox for some reason) it trys to download the page i'm using to redirect to the file. Is there a way of stopping this? This is what i have at the moment: Header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename="'.$filename.'"'); Header("Location: " . $downloadURL . $string . "/" . $filename); Quote Link to comment Share on other sites More sharing options...
jaymc Posted February 28, 2008 Share Posted February 28, 2008 download that page in firefox and view the source, what does it say? If filename contains slashes or any weird chars it can throw an error strange only in firefox though But yeh, when downloaded via firefox biew the source of the file Quote Link to comment Share on other sites More sharing options...
c_shelswell Posted February 29, 2008 Author Share Posted February 29, 2008 the file that it's downloading is the same size as the zip file it should be downloading so i think it's probably just naming it wrong but that's what i thought the header code was supposed to do, force it to name correctly?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.