0

I am currently working on a website which will be used for displaying scores in several benchmarks. In order to accomplish this, i am using PHP(duh :D) for the database queries and the JPGraph library, which creates the graph and then displays and it as an image with the GD library.

The user of the site can select which chart he wants to see with a <form> that contains the following criteria:

  1. The Client that ran the test
  2. The Operating System the Client used at the time
  3. The Benchmark that was used
  4. And what type of chart he wants to see (Bar graph, line graph....)

All of this works fine, the graph is displayed without a problem in the <iframe> that it is supposed to be in.

However, I also want the user to be able to save the Graph, with, say a second button. I can get the GD handle of the image, but how can I use this to save the image to a file on the client?

Any help would be very welcome.

Regards,
Andy

AndMim
  • 550
  • 1
  • 3
  • 11
  • http://php.net/imagejpeg ? – Marc B Jul 11 '13 at 14:50
  • I've seen that, but how can I then save it on the clients computer, if there is a way at all? – AndMim Jul 11 '13 at 15:21
  • http://stackoverflow.com/questions/7263923/how-to-force-file-download-with-php – Marc B Jul 11 '13 at 15:23
  • This is sort of what im looking for, but not really. I want the user to be able to save it if he wants, not force the image to be downloaded. – AndMim Jul 11 '13 at 16:23
  • the user can't just right-click the image and go save-as? If you want to provide a "save to disk" button, then you need that "force download" stuff on the server. – Marc B Jul 11 '13 at 17:57

0 Answers0