koopi Posted October 20, 2017 Share Posted October 20, 2017 Hi guys, I need help with a script i'm trying to run. I want to include few headers is the same script: header ('Location:http://www.google.com'); header("Content-disposition:attachment; filename=file.txt"); header("Content-type:application/txt"); readfile("file.txt"); But if i run the scrpit it's only enters to google and ignore the other headers (that force download file.txt). I need that the user will access google and also will be prompted to download the file.txt in parallel. Link to comment Share on other sites More sharing options...
requinix Posted October 20, 2017 Share Posted October 20, 2017 You cannot do both at the same time. Have the source page do two requests: one to your script to download the file, then after another to perform the redirect (which you might as well just do in the Javascript). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.