0

I see flash has a save call to do this job, but it requires user interactive.

How to save it automatically?

wamp
  • 5,789
  • 17
  • 52
  • 82
  • 2
    if i'm the user, i wouldn't want to use your application... – ultrajohn Jul 02 '10 at 09:16
  • But it's only used at server side. – wamp Jul 02 '10 at 09:24
  • AFAIK, there's no built-in `save` method! what is this supposed to do? Maybe you meant `browseForSave` which is only available in AIR. – Makram Saleh Jul 02 '10 at 09:26
  • Then how to post an image to save at server side with flash ? – wamp Jul 02 '10 at 09:36
  • @Makram There is a [save](http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/FileReference.html#save%28%29) method in the `FileReference` class that targets Flash player 10. – Amarghosh Jul 02 '10 at 09:39
  • @Amarghosh,isn't it already cited in my post? It just requires user interative. – wamp Jul 02 '10 at 09:42
  • Did you notice that I was talking to @Makram who wasn't aware of `save` method (which was not present in Flash 9)? – Amarghosh Jul 02 '10 at 09:48
  • And the said save method doesn't do what you think it does - it's for saving file on client's machine, not the server. Try to be nice to the people who're trying to help you - especially if you cannot express your question clearly. – Amarghosh Jul 02 '10 at 09:49

3 Answers3

2

It seems you are trying to save the file at the server side. If this image is from the hard disk of the user, then you cannot do it without user interaction. Basically, you can't just steal files from user.

If it is generated using your SWF itself, you can encode the image's bitmapData to PNG format and upload it to the server using a URLLoader and save it to file using your server script.

Community
  • 1
  • 1
Amarghosh
  • 58,710
  • 11
  • 92
  • 121
0

For security reasons, this is not possible.

Sjoerd
  • 74,049
  • 16
  • 131
  • 175
0

Unfortunately you can't, otherwise Flash would be the #1 virus uploader of all time.

SeniorShizzle
  • 984
  • 1
  • 11
  • 27
  • If true most server sides languages should be virus. – wamp Jul 02 '10 at 09:34
  • Most server side languages are sandboxed by the browser, but since Flash runs as a system-wide plugin and not solely in the browser it has a more threatening potential. – SeniorShizzle Jul 02 '10 at 09:39