-
ByteArray to FileReference
I know I can use this to save ByteArray data to disk:
Actionscript Code:
var ba:ByteArray = new ByteArray; ba.writeUTFBytes('<?xml version="1.0" encoding="iso-8859-1"?>\n'+text) var fr:FileReference = new FileReference(ba); fr.browse(new Array(new FileFilter("XML (*.xml)", "*.xml;"))); fr.save( ba, 'ticker.xml' );
...But is it possible to use the upload() method to write the same ByteArray to a server?
Actionscript Code:
var request:URLRequest = new URLRequest("http://www.[domain].com/uploader_script.php") fr.upload(request);
Thanks all.
-
Dignitary
Are you using the AIR framework?
-
It is a browser-based application using Flash Player.
-
Dignitary
The FileReference class provides a means to upload and download files between a user's computer and a server. An operating-system dialog box prompts the user to select a file to upload or a location for download. Each FileReference object refers to a single file on the user's disk and has properties that contain information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only).
Note: In Adobe AIR, the File class, which extends the FileReference class, provides more capabilities and has less security restrictions than the FileReference class.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|