homepage Welcome to WebmasterWorld Guest from 54.204.215.209
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Server response with Flex and PHP
andyd273




msg:3462575
 1:02 pm on Sep 27, 2007 (gmt 0)

I have a working upload swf that does a batch upload and then uses FileReference and PHP to put the file in the right place. However, I have two things that I'm trying to do.

1. I'm trying to pass more than one value to the upload.php script. I know I can do it using HTTPService, but I'm having trouble getting HTTPService to pass text values along when the file is uploaded.

2. I want to get information back from upload.php, something like
<?
$filestatus = move_uploaded_file($file_temp,$file_path."/".$file_name);
if(!$filestatus) {
echo "Upload failed. Please try again.";
}
?>
and have it show up in a textarea or something.
Once again, I know how to do it with HTTPService, but I don't know how to make the FileReference trigger the HTTPService and listen to the result.

 

andyd273




msg:3462588
 1:12 pm on Sep 27, 2007 (gmt 0)

I think I found the answer to #1 with URLVariables.

var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";
sendVars.username = {txtUsername.text};

which should let me pass any variables that I want to the upload.php script.

andyd273




msg:3463156
 9:04 pm on Sep 27, 2007 (gmt 0)

I figured out the answer to #2
_refUploadFile.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, uploadDataComplete);

this is an event that triggers when the upload is completed and data is returned.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved