Gday guys,
im making a lil flex app to upload images for guys on my forum… problem is, it works fine in opera and firefox im told now also, but in internet explorer… im getting this error…
“Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
at uploadd$iinit()
at _uploadd_mx_managers_SystemManager/create()
at mx.managers::SystemManager/::initializeTopLevelWindow()
at mx.managers::SystemManager/::docFrameHandler()”
this is my code? its str8 off the adobe site itself. from what i gather, its the way the scipt is handling the error itself? its terminating itself bcos of it.?
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.events.DataEvent;
public var fileRef:FileReference = new FileReference();
public function upload():void {
// listen for the file selected event
// listen for the upload complete event
fileRef.addEventListener(Event.SELECT, selectHandler);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA , uploadCompleteHandler);
// browse for the file to upload
// when user selects a file the select handler is called
try {
var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
var allTypes:Array = new Array(imageTypes);
var success:Boolean = fileRef.browse(allTypes);
}
catch(error:IOErrorEvent) {
trace("IOErrorEvent catch: " + error);
}
}
// when a file is selected you upload the file to the upload script on the server
public function selectHandler(event:Event):void {
var request:URLRequest = new URLRequest("upload.php")
try {
// upload file
fileRef.upload(request);
textarea1.text = "uploading " + fileRef.name + "...";
}
catch(error:IOErrorEvent) {
trace("IOErrorEvent catch: " + error);
}
}
// dispatched when file has been given to the server script. does not receive a response from the server
public function completeHandler(event:Event):void {
trace("file uploaded complete");
}
// dispatched when file has been uploaded to the server script and a response is returned from the server
// event.data contains the response returned by your server script
public function uploadCompleteHandler(event:DataEvent):void {
trace("uploaded... response from server:
" + String(event.data));
textarea1.text += event.data as String;
}
]]>
</mx:Script>
Also id like to be able to directly have the link traced into the message box itself, so people dont have to copy n paste… is there an easy solution in the php code?
Heres the link, the upload is on the left of the main reply box… heres a direct link to the forum, use
User: Ryann
Pass: temp
http://www.weride.net/ThrashedMinis/phpBB2/
, and press a reply or new topic sumwere to view it… thanks for anyone taking a look…
Ryann.