views:

38

answers:

3

Hello,

as an work assignment, I have to alter old flash app written with actionscript 2 to let users upload image in one movieclip.

Since i have no control over placement of that flash in server, is it possible to do this without any PHP code (yes, flash is on site on LAMP stack), with flash only? I.E. - user uploads image to flash application, which creates in itself temporary copy of image, that user 'copied' from his disk?

Thank you

+1  A: 

In short, No. The upload method of a flash.net.FileReference object takes a parameter of the URL to post the file data to.

This would need to be a script that writes the file to disk or some other operation.

See http://livedocs.adobe.com/flash/9.0/main/00001679.html

Greg B
Thank you. / / /
Adam Kiss
+2  A: 

It is possible in Flash Player 10.

http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

But since you say you are to alter an old AS2 based Flash, it may not be realistic to use that feature, it would probably be more of an entire rewrite.

Lars
+1. But I suppose, a rewrite wouldn't be necessary. One could load a flash 10 swf for the job, create a tiny interface through local connections (if necessary), and then extract the image data from the swf with `BitmapData::draw` (assuming the 2 swfs are in the same domain, which I guess is feasible. The "loader" could even just be a mere asset of the main app).
back2dos
@Lars, @back2dos - rewrite, or combining 2 different as versions isn't in place in this project. Tight budget and time make it impossible to play with. Thank you though.
Adam Kiss
+1  A: 

Basically no, because Flash is a client-side scripting language, you would need the flash file to send the data to a server-scripting language page (like php), you can find some example at that address : http://www.flashkod.com/codes/UPLOAD-DOWNLOAD-SUPPRESSION-FICHIERS-FLASH-PHP-AVEC-CLASSE_36031.aspx

Dominique
Thank you. / / /
Adam Kiss