Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-19-2011, 05:22 PM   #1
overmann
Registered User
 
Join Date: Nov 2010
Location: The Robot Ark
Posts: 22
Default File upload using flex.

ActionScript Code:
/*Flex code*/                  private const UPLOAD_URL:String = "http // myhosting / upload/ upload.php";            private var cer:FileFilter = new FileFilter("Archivos Cer", "*.cer");            private var key:FileFilter = new FileFilter("Archivos Key", "*.key");            private var fileref:FileReference = new FileReference();            private var fileref2:FileReference =  new FileReference();             protected function button_clickHandler(event:MouseEvent):void         {                          var request:URLRequest = new URLRequest();      request.method = URLRequestMethod.GET;      request.url = UPLOAD_URL;      fileref.upload(request);      fileref2.upload(request);         }

Well, that's the procedure I use to get my files up my server. The "upload.php" in my server is:

PHP Code:
  <?php 
     $target 
"upload/"
     
$target $target basename$_FILES['uploaded']['name']) ; 
     
$ok=1
     if(
move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
     {
     echo 
"The file "basename$_FILES['uploadedfile']['name']). " has been uploaded";
     } 
     else {
     echo 
"Sorry, there was a problem uploading your file.";
     }
     
?>
Is there a way to do this in FLEX only?

Last edited by overmann; 01-19-2011 at 05:27 PM.
overmann is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:57 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.