A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Retrieving php output on FileReference.onComplete

  1. #1
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568

    Retrieving php output on FileReference.onComplete

    Code:
    	
    
    //php uploader 
    
    $target_path = "/user/toto.jpg";
    
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path))
    {
       $status = "1";
    }
    else
    {
       $status = "0";
    }
    	
      print("&status=$status");
    In the FileReference.onComplete method, how can I retrieve the &status variable printed in the php file. It would make no sense to have no way to retrieve this data.

    thx

    Martin

  2. #2
    Moderator enpstudios's Avatar
    Join Date
    Jun 2001
    Location
    Tampa, Fl.
    Posts
    11,282
    PHP Code:
    <?php

    //path to storage
    $storage 'uploadedFiles';

    //path name of file for storage
    $uploadfile "$storage/" basename$_FILES['Filedata']['name'] );

    //if the file is moved successfully
    if ( move_uploaded_file$_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
        echo( 
    '1 ' $_FILES['Filedata']['name']);

    //file failed to move
    }else{
        echo( 
    '0');
    }

    ?>

  3. #3
    Senior Front End Developper
    Join Date
    Dec 2000
    Location
    Montréal
    Posts
    568
    ... well I was wandering how to retrieve this data inside the flash.

    The onComplete callback only return a reference to the file (Reference.onComplere (file:FileReference) ) and even if I rename the file on the server while copying it, the file.name property still returns the original file name without the folder path on the server.

    I'm not sure what is the goal of putting echo in the php file if there is now way to retrieve it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center