Upload jpeg and send jpeg name to flash?

hello,

i was wondering if it’s possible to upload a jpeg with PHP within a php page opened with a swf and that php sends back to the swf the name of the jpeg…
If it is, has anyone got tips for me :blush:

so far this is what i have for PHP:


<?php

$uploadfolder="$DOCUMENT_ROOT/images/";

if ($REQUEST_METHOD=='POST') {
  
  # check if jpg 1 was attached/uploaded
  if ($file1 && $file1!="none") {
    if ($file1 && $file1_size>0) {
      # check extension
      preg_match("/.*\.(.*)/", $file1_name, $match);
      $file1_ext=strtolower($match[1]);
      if ($file1_ext=="jpg") {
        # move image to right folder
        move_uploaded_file($file1,$uploadfolder."image1.jpg");
        
        $resultstr="File successfully uploaded!<br>";
        }
      else {
        $resultstr="File is no .jpg!<br>";
        }
      }
    else {
      $resultstr="Upload of jpg failed!<br>";
      }
    }
  
  }
?>

but how do i send to flash the jpeg’s name??