سؤال

I'm attempting to save an image in flash, with the current code:

var fileReference:FileReference = new FileReference();
fileReference.save(byteArray);

That code opens up a "Save As" dialog box, prompting the user to pick a destination for where the file should be saved.

I want to specify a specific location for the file in the code, so the prompting of the "Save As" box is not necessary.

I've tried to add a second argument to fileReference.save(); but that seems to only set the default file name, not the path:

fileReference.save(byteArray,"myfile.jpeg");

Any ideas on how I could do so?

هل كانت مفيدة؟

المحلول

If this is a Flash Player web project and not an AIR project, then I'm afraid you're out of luck. All file access operations in Flash Player have to go through the user for security reasons.

نصائح أخرى

You can't do that for security reasons. However if you were building an AIR app you could use FileStream class

not sure this is what you are looking for, but if you want to save the file in a hidden location inside the user computer you can use the SharedObject class, documentation here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top