You'll need to use the Flex FileReference class.

If you do a Google search for Flex File Upload you will find a number of 
examples.

--- In flexcoders@yahoogroups.com, "isa_loyer" <isa_loyer@...> wrote:
>
> Dear Flex,
> 
> I search some idea to load local file to remote server with php.
> I try to do that, but it didn't works
> 
>  var rq:URLRequest = new URLRequest(new urlManager().urlService() + 
> "upload.php");
>                                       rq.method = URLRequestMethod.POST;
>                                       var varphp:URLVariables = new 
> URLVariables();
>                                       varphp.userID = monIdPatient;
>                                       varphp.url = myFileDir;
>                                       
>                                       rq.data = varphp;
>                                       file.upload(rq, 'Filedata');    
> 
> 
> <?php
> if(isset($_POST['myFileDir']))      
> $patRoot=$_POST['myFileDir'];
> 
> $file_temp = $_FILES['Filedata']['tmp_name'];
> $file_name = $_FILES['Filedata']['name'];
> 
> $file_path = $_SERVER['DOCUMENT_ROOT'].$patRoot";
> 
> //checks for duplicate files
> if(!file_exists($file_path."/".$file_name)) {
> 
>      //complete upload 
>      $filestatus = move_uploaded_file($file_temp,$file_path."/".$file_name);
> 
>      if(!$filestatus) {
>      $success = "false";
>      array_push($errors,"Upload failed. Please try again.");
>      }
> 
> }
> else {
> $success = "false";
> array_push($errors,"File already exists on server.");
> }
> 
> echo $file_path;
> 
> 
> 
> Thanks for helping.
>


Reply via email to