开发者

Flex: Getting return result on file upload

开发者 https://www.devze.com 2022-12-19 19:24 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消