Page 1 of 1

Open/Save Dialogue Box, Remote Host

Posted: Wed Jan 28, 2009 10:13 am
by ajacian
Hey everyone,

Sorry if this has been asked before, I searched but couldn't find anything. The issue i'm having is that we have a partner who serves downloadable images for us; users can click a link on our site and they will be presented the image to download. The partner serves it as a standard JPG, and therefore loads it directly into the browser; however, we need to issue a FILE/SAVE Dialogue box to the user. Unfortunately, we are not able to ask the partner to change anything from their side; what we've had to resort to doing was Saving the image to oursite and then popping up the File/Save Dialogue box. Unfortuneatly, this too is no longer an option due to the long wait times for our users and bandwidth issues. Is there ANY way we can directly link to the image on our partner's site and display the F/S Dialogue Box?

Thanks in advance,
-ajacian

Re: Open/Save Dialogue Box, Remote Host

Posted: Wed Jan 28, 2009 6:39 pm
by ajacian
any help?

Re: Open/Save Dialogue Box, Remote Host

Posted: Mon Feb 02, 2009 8:48 am
by ajacian
please?

Re: Open/Save Dialogue Box, Remote Host

Posted: Mon Feb 02, 2009 9:15 am
by mickeyunderscore
Try the following: (I ran this and it worked for me, using Firefox 3.0.5)

Code: Select all

 
$f = file_get_contents($image_location);
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: image/jpeg');
header('Content-Disposition: attachment; filename="test.jpeg"');
header("Content-Transfer-Encoding: binary");
echo $f
 
Don't think this will solve the bandwidth problem though, but it will save you having to copy images over

Re: Open/Save Dialogue Box, Remote Host

Posted: Mon Feb 02, 2009 9:55 am
by ajacian
i appreciate the help, thank you. However it's still being (even if very temporarily) copied to the server via file_get_contents. I can no longer ready any of the contents of the file to the server.