I have my diagram output to my download folder on the server with
$plot->SetOutputFile($output_file);
I can download ist from there with fetch or access it via browser with the address in the download folder and save ist to desktop.
It is shown correctly also in the browser window.
I want to let the user download the diagramm with a download button. I realized that with various attempts, last with the script found on [http://www.web-development-blog.com/archives/php-download-file-script/]
This works fine, and the diagram is downloaded and recovered as JPEG-File. But opening fails: damaged or wrong format.
What can I do?
phplot 6.2.0
PHP 5.4
MacOS X 10.10.5
Safari, FireFox
Opening with
Preview, Photoshop CS5
thanks
ruedi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The first thing that comes to mind is - is it really a JPEG image file? Because it would be unusual to use JPEG wth PHPlot and that is not the default. (JPEG will be of lower quality for PHPlot-type images, so its use is not recommended.) Perhaps you are creating a PNG file (the PHPlot default), but your download script is specifying the wrong MIME type image/jpeg, or suggesting the wrong filename extension? That would probably cause the error message you are seeing when you try to open it. (Or it could be something else entirely.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have my diagram output to my download folder on the server with
$plot->SetOutputFile($output_file);
I can download ist from there with fetch or access it via browser with the address in the download folder and save ist to desktop.
It is shown correctly also in the browser window.
I want to let the user download the diagramm with a download button. I realized that with various attempts, last with the script found on
[http://www.web-development-blog.com/archives/php-download-file-script/]
This works fine, and the diagram is downloaded and recovered as JPEG-File. But opening fails: damaged or wrong format.
What can I do?
phplot 6.2.0
PHP 5.4
MacOS X 10.10.5
Safari, FireFox
Opening with
Preview, Photoshop CS5
thanks
ruedi
The first thing that comes to mind is - is it really a JPEG image file? Because it would be unusual to use JPEG wth PHPlot and that is not the default. (JPEG will be of lower quality for PHPlot-type images, so its use is not recommended.) Perhaps you are creating a PNG file (the PHPlot default), but your download script is specifying the wrong MIME type image/jpeg, or suggesting the wrong filename extension? That would probably cause the error message you are seeing when you try to open it. (Or it could be something else entirely.)