You can send data to the server with the
for example,
http://www.myserver.com/upload.cgi?userID=jdoe
On some browsers, URL strings are limited in length. Lengths greater than 256 characters
may fail on some browsers or servers.
Returns
- A value of
Boolean
FileReference.browse()
FileReferenceList.browse()
array.
filelist
The protocol is not HTTP or HTTPS.
A security violation occurs; that is, if your SWF file attempts to access a file from a server
that is outside your SWF files's security sandbox.
The
parameter is of the incorrect type or format.
url
The call does not have the correct number of parameters.
Example
The following example shows an implementation of the
the user to select a file to upload, then handling the
finally handling the results of the actual file upload.
import flash.net.FileReference;
var allTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.jpg, *.jpeg, *.gif, *.png)";
imageTypes.extension = "*.jpg; *.jpeg; *.gif; *.png";
allTypes.push(imageTypes);
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
if(!file.upload("http://www.yourdomain.com/
yourUploadHandlerScript.cfm")) {
trace("Upload dialog failed to open.");
}
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
582
ActionScript classes
upload()
in any of the following situations:
false
has not yet been successfully called on this object, or if
has not yet been successfully called with this object in its
call by appending parameters to the URL;
method by first prompting
upload()
and
onSelect
onCancel
listeners, and
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?