Reputation: 36034
I'm looking into uploading an XML file and then storing it's contents in database. It looks like upload method of flash.net.FileReference would do the job however it just gives you an option to upload it to server.
I could upload it to server, read it from that server and then delete that file but I would like to avoid extra work.
Is there a way to just load a file into memory without saving it on some remote location?
Upvotes: 0
Views: 154
Reputation: 90736
No this cannot be done, uploads can only be done to a server, probably for security reason.
If you need to store the content to a database anyway, why don't you make the server-side bakend handle it?
If this is just some data that you need then throw away after the program is complete, perhaps you could consider asking the user to copy and paste their data to some textfield. That might depend on your target audience thought: IT-types - no problem, non-IT types-problem :D
Upvotes: 1
Reputation: 684
yes you can load all content in to cache, just push it into an array, when ever you want it just call it out.
Upvotes: 0
Reputation: 11590
If you are trying to have the user select an XML file from their local machine, after your myFileReference.load()
, in your Event.COMPLETE
handler function you can use var myXML:XML = XML(myFileReference.data);
to get the data of the file you selected.
Upvotes: 0