# Output JPG from webpage using jpegencoder?

**URL:** <https://forum.kirupa.com/t/output-jpg-from-webpage-using-jpegencoder/322310>\
**Category:** flash\
**Created:** [May 17, 2011, 4:45pm UTC](https://forum.kirupa.com/t/output-jpg-from-webpage-using-jpegencoder/322310 "2011-05-17T16:45:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hzle](https://avatars.discourse-cdn.com/v4/letter/h/46a35a/32.png) [@Hzle](https://forum.kirupa.com/u/Hzle)\
**Post date:** [May 17, 2011, 4:45pm UTC](https://forum.kirupa.com/t/output-jpg-from-webpage-using-jpegencoder/322310/1 "2011-05-17T16:45:16Z")

</div>

Related to my last question on this forum, but this is a query on what my approach to a problem should best be. I want a someone using my .swf from a browser to be able to download a “snapshot” of the swf onto their machine as a .jpg file.

I know that its possible to do this with server side PHP, as described in this thread, and a couple of blogs.

But is it possible to do it just with client-side .swf & code? I can imagine a couple of ways of doing this:

1. sending the data to a javascript function on the page (if there’s no limit on ho much you can send to a JS function via this method, which I don’t know) This seems a very clunky way of doing it\*

2. using a FileReference:

```auto

 	var fr:FileReference = new FileReference();
 	fr.save(jpgStream, "copy.jpg");

```

…works from stand-alone FlashPlayer, but could it work from the browser? Hasn’t worked for me yet.

Though I’m sure I remember one of the chart libraries (amLine?) doing this. Maybe they did use PHP - but I thought not …

Thanks in advance

- with IE before version 9 you could “force” a download of text to a file using javascript - but not on other browsers and this was no doubt seen as a security risk of IE. May have answered my own question there :S
