For For some reason, I'm not getting any result returned to me when uploading a file to my server. I'm using a php script, the file gets sent, gets uploaded, but I can't get the return result.
I am firing these event listeners:
fileRef.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);
fileRef.addEventListener(Event.COMPLETE, fileRef_complete);
fileRef.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onFileResponse);
fileRef.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPEvent);
Then my upload script
fileRef.upload(urlReq, "Filedata", false);
Then for the OnFileResponse Function
private function onFileResponse(event:DataEvent)
{
Alert.show("UPLOADED FILE", "TESTING FILE UPLOAD");
trace("UPLOAD COMPLETE = " + event.text + " , " + event.data);
}
and the php script:
<?php
$uploadDir = "/images/Thumbs/";
$filename = $_F开发者_开发问答ILES['Filedata']['name'];
$tmpName = $_FILES['Filedata']['tmp_name'];
move_uploaded_file($tmpName, $uploadDir.$filename);
echo "testing";
?>
Ok, this was completely a careless mistake on my part. I just was calling everything out of order.
精彩评论