all groups > flash actionscript > december 2006 >
You're in the

flash actionscript

group:

HTTPResponse for file upload


HTTPResponse for file upload AmarShah
12/18/2006 11:42:11 PM
flash actionscript: Hi,
I am uploading an image using flash8. Now When I upload the image the PHP
will store the file on the server and will return the complete url for the
image as response. Now How can i get the response back in flash or in my
browser?

Thanks

Re: HTTPResponse for file upload Hero Protagonist
1/11/2007 10:45:25 PM
Hello Amar,

I believe in AS2 there is an event for the FileReference Class called
?onComplete?.

If you add an event listener to the File Reference object and listen for the
onComplete event then you would get a response in Flash when an file upload or
download has completed. Consequently the web browser returns and HTTP Status
of 200 on a successful download or upload.


http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.ht
m?context=LiveDocs_Parts&file=00002215.html

I believe the equivalent event in AS3 is just called ?complete?.

Hope that helps;

-Ken

Re: HTTPResponse for file upload AmarShah
1/11/2007 11:17:58 PM
Hi Ken,
Thanks for your reply. The problem is onComplete event doesn't give
me any response object that I can use to display the response from the server.
Say like in Central 1.5 has an event called onUploadSuccess, which returns the
response object that shows the server response. Flash onComplete does not have
this kind of return value available. I am attaching sample central 1.5 code for
your reference.

listener.onUploadSuccess = function(fileRef, response) {
textarea.txt = response;
gShell.setProgress(0);
gShell.setStatus("File upload completed");
}


Thanks
Amar
AddThis Social Bookmark Button