Simple image upload problem

Hi Everyone,
I opened a thread on this issue in Flash forum also but i think this might be a PHP issue so please have a look at it.
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.

Thanks for reading.

Is PHP installed and configured correctly on the other 2 servers?

Yes PHP is installed , i can upload through html and php using the same code but not when i use Flash. Is there anything else i have to do in installation to make flash work with PHP.

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.

Sounds like a directory permissions thing - I’d check all the permissions on all servers to see if there are any differences

HI,
Thanks for all your help mate. I tried changing the directory permissions to everything from 775, 777, 644… but it still doesn’t load. :frowning:

I don’t use PHp much but is there any chance that the server needs some other syntax to execute it?

I used PHP with html with permissions 644 and it uploads. Here is the PHP code i used with HTML:

**<?php
$target = “./”;
$target = $target . basename( $_FILES[‘uploaded’][‘name’]) ;

$change = basename( $_FILES[‘uploaded’][‘name’]);
move_uploaded_file($_FILES[‘uploaded’][‘tmp_name’], $target)
?>**

Actually there is only one server out of the 2 non working hosts where i need it, but there it doesn’t even return to listener.onComplete in Flash. Not sure what all it is doing in the background.

Ok i think there might be some issue in the security features of my host as i searched. Thanks for your help.
I will put it here if that is the case because everything else seems all right.