I am writing component that will be used for selling digital photography. I have written the module to store the original files in a secure non web accessible directory. I have a function being called by the controller.php which sends the image to the browser.
The function sends two headers to the browser. Then the data.
header("Content-Type: image/jpeg",TRUE);
header('Content-Disposition: attachment; filename="' . $this->name . '.jpg"',TRUE);
echo file_get_contents($this->path_to_file);
However it only outputs the filename and in the download link it tells the browser an html document is coming.
If any one can tell me how to tell the browser that it's just a jpeg and then send it I would be very appreciative.
Thank you
Fletch
Outputing images from a file within joomla. Topic is solved
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules