type (FileReference.type property)
public type : String [read-only]
The file type. In Windows, this property is the file extension. On the Macintosh, this
property is the four-character file type. If the FileReference object has not been populated, a
call to get the value of this property returns
.
null
Availability: ActionScript 1.0; Flash Player 8
Example
The following example retrieves the type of a file selected by the user.
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("type: " + file.type);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse();
See also
browse (FileReference.browse method)
upload (FileReference.upload method)
public upload(url:String) : Boolean
Starts the upload of a file selected by a user to a remote server. Flash Player can upload files of
up to 100 MB. You must call
or
FileReference.browse()
FileReferenceList.browse()
before calling this method.
Listeners receive events to indicate the progress, success, or failure of the upload. Although
you can use the FileReferenceList object to let users select multiple files to upload, you must
upload the files one by one. To do so, iterate through the
FileReferenceList.fileList
array of FileReference objects.
580
ActionScript classes
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?