# FLASH PHP uploading images problem

**URL:** <https://forum.kirupa.com/t/flash-php-uploading-images-problem/264870>\
**Category:** flash\
**Created:** [July 1, 2008, 2:45pm UTC](https://forum.kirupa.com/t/flash-php-uploading-images-problem/264870 "2008-07-01T14:45:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![energy](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@energy](https://forum.kirupa.com/u/energy)\
**Post date:** [July 1, 2008, 2:45pm UTC](https://forum.kirupa.com/t/flash-php-uploading-images-problem/264870/1 "2008-07-01T14:45:53Z")

</div>

Hi Everyone,

I am trying to upload an image on my server using Flash and PHP. The following code works fine on 1 server but doesn’t work on other 2 servers where i have to implement it. Please check it and see where am i going wrong.  
FLA CODE:

* * *

\*\*listener.onSelect = function(selectedFile:FileReference):Void {

// Flash is attempting to upload the image.  
statusArea.text += "Wait…trying to upload " + selectedFile.name + "  
";

selectedFile.upload(“upload.php”);

## };\*\*

## PHP CODE:

## \*\*\<?php $target = “./”; $target = $target . $\_FILES[‘Filedata’][‘name’]; move\_uploaded\_file($\_FILES[‘Filedata’][‘tmp\_name’], $target); chmod("./".$\_FILES[‘Filedata’][‘name’], 777); ?\> \*\*

The other 2 servers shows that it is uploading but doesn’t upload. Not sure if flash is executing PHP file on those.  
I am really struggling to make it work on other servers. I just cldn’t understand the logic that why does it just work on one server and not others. Any kind of help will be highly appreciated.

Thank You.

---

<div class="post-metadata">

**Author:** ![energy](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@energy](https://forum.kirupa.com/u/energy)\
**Post date:** [July 1, 2008, 3:37pm UTC](https://forum.kirupa.com/t/flash-php-uploading-images-problem/264870/2 "2008-07-01T15:37:12Z")

</div>

And one more thing. I have  
listener.onComplete also in my flash code which shows it has “uploaded”.

And one of the two non-working servers even executes that. But the other doesn’t come in listener.onComplete.
