Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > FileReference (flash.net.FileReference) > onHTTPError (FileReference.onHTTPError event listener) | |||
onHTTPError = function(fileRef:FileReference, httpError:Number) {}
Invoked when an upload fails because of an HTTP error.
Because of the way that Flash Player relies on the browser stack during file download, this error is not applicable for download failures. If a download fails because of an HTTP error, the error is reported as an I/O error.
Availability: ActionScript 1.0; Flash Player 8
fileRef:flash.net.FileReference - The File Reference object that initiated the operation.
httpError:Number - The HTTP error that caused this upload to fail. For example, an httpError of 404 indicates that a page is not found. HTTP error values can be found in sections 10.4 and 10.5 of the HTTP specification at ftp://ftp.isi.edu/in-notes/rfc2616.txt.
The following example creates a FileReference object with a listener for each possible event including onHttpError. This listener is triggered only if the upload fails because of an HTTP error.
import flash.net.FileReference;
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");
}
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onHTTPError = function(file:FileReference):Void {
trace("onHTTPError: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
listener.onSecurityError = function(file:FileReference, errorString:String):Void {
trace("onSecurityError: " + file.name + " errorString: " + errorString);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse();
Version 8
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002216.html
Comments
Chuck Deisler said on Sep 19, 2005 at 3:24 PM : dr. feelgood said on Dec 6, 2005 at 6:27 AM : No screen name said on Jan 24, 2006 at 4:41 AM : Shinkaze said on Apr 13, 2006 at 4:36 PM : R3DD4G said on May 17, 2006 at 3:49 PM : No screen name said on Oct 4, 2006 at 2:42 PM : HC00JW said on Jan 15, 2007 at 5:51 AM : porbista said on Jan 26, 2007 at 6:59 AM : stevensanborn said on Feb 9, 2007 at 6:20 PM : sophie119 said on Mar 2, 2007 at 5:30 AM : eddy_ said on Mar 6, 2007 at 10:26 AM : stephen2earth said on May 9, 2007 at 1:50 AM : wraevn said on May 14, 2007 at 9:26 AM : stephen2earth said on May 15, 2007 at 3:59 AM : flairman said on Jun 20, 2007 at 9:46 PM : stephen2earth said on Jun 26, 2007 at 1:43 PM :