# Upload jpeg and send jpeg name to flash?

**URL:** <https://forum.kirupa.com/t/upload-jpeg-and-send-jpeg-name-to-flash/122869>\
**Category:** Uncategorized\
**Created:** [September 17, 2004, 8:03pm UTC](https://forum.kirupa.com/t/upload-jpeg-and-send-jpeg-name-to-flash/122869 "2004-09-17T20:03:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [September 17, 2004, 8:03pm UTC](https://forum.kirupa.com/t/upload-jpeg-and-send-jpeg-name-to-flash/122869/1 "2004-09-17T20:03:19Z")

</div>

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 😊

so far this is what i have for PHP:

```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??
