<?php
$uploaddir = 'media/';
$file = basename($_FILES['photo']['name']);
$uploadfile = $uploaddir . $file;
if (move_uploaded_file($_FILES['photo']['tmp_name'], $uploadfile)) {
echo "GOOD";
} else {
echo "ERROR";
}
?>
I have this php script on my AWS EC2 linux server.
And it always return ERROR. I did chmod 777 and chmod 755 but still complains.
What is the problem? This code works just fine with another web server not Amazon EC2.
Is there any limitation that I can not upload files(images) through php on Amazon EC2?
Thanks in advance..
You can check it by function file_exists..
you can modify your code for better understanding..