Cannot write local files to Flash Player 10+ on the Internet (but works when used locally)

I am trying to write a local file using Flash Player 10+ using the FileReference class, following the format of this blog post by Mike Chambers: http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local -files-in-flash-player-10 /

Essentially, this is the code:

private function onSaveButtonClick(event:MouseEvent):void{ fr = new FileReference(); fr.save(fileToSave);} 

It works fine locally on my machine, but when used on the Internet it does not call up the save file dialog when the save button is clicked. I assume these are some kind of permissions or security issue?

+6
source share
2 answers

You should check your log for SecurityError s. Sandboxing is almost always the cause when IO works locally, but not online.

+1
source

Your FileReference instance may be garbage collected. The same thing happens with file upload.

Try moving it to the instance variable:

 private var fr = new FileReference(); private function onSaveButtonClick(event:MouseEvent):void{ fr.save(fileToSave); } 
0
source

Source: https://habr.com/ru/post/907417/


All Articles