hi,
i am trying to have a link to download a jpg directly, not display it in the browser.
i've got
<?php
if(isset($filename)):
$headertxt = "Content-Disposition: attachment; filename=\"".$filename."\"";
header("Content-Type: application/force-download");header($headertxt);
include("$filename");
endif;
?>
it works fine for opening an html or text files, it prompts me to save and does so properly.
however on jpg it prompts me to save as well, but only saves
<b>Parse error</b>: syntax error, unexpected T_STRING in <b>/test.jpg</b> on line <b>93</b><br />
any help or suggestions would be greatly appreciated!
many thanks!!
i am trying to have a link to download a jpg directly, not display it in the browser.
i've got
<?php
if(isset($filename)):
$headertxt = "Content-Disposition: attachment; filename=\"".$filename."\"";
header("Content-Type: application/force-download");header($headertxt);
include("$filename");
endif;
?>
it works fine for opening an html or text files, it prompts me to save and does so properly.
however on jpg it prompts me to save as well, but only saves
<b>Parse error</b>: syntax error, unexpected T_STRING in <b>/test.jpg</b> on line <b>93</b><br />
any help or suggestions would be greatly appreciated!
many thanks!!
Kommentar