I have code which downloads a picture from a fake link. I have looked at others comments / sites but nothing has helped me find the solution to the annoying :
\"Fail
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-type: application/x-unknown"); // I always use this
header("Content-Disposition: attachment; filename='theFilename.ext'");
header("Content-Transfer-Encoding: binary");
header("Content-Length: 177998"); // you might want to set this
readfile('/the/url/to/theFilename.ext');
This will work ;-)
Okay, so through a convo's with vimeo, and figuring out that the problem was due to Content-Disposition: attachment. They told me this is an issue that is inherit with browsers. You are not supposed to use a different DNS for loading resources, so it will work but the browsers won't be happy about it.