Файл загружается и выдает в конце что все прошло успешно но в папке файл не появляется.
Права выставлены
sudo chmod -R 777 /Applications/XAMPP/
{"Message":"The file 374.png has been uploaded.","Status":"OK"}
Index.php
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
Upload.php
<?php
$target_path = dirname(getcwd()).'/img/';
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo json_encode([
"Message" => "The file ". basename($_FILES["uploadedfile"]["name"]). " has been uploaded.",
"Status" => "OK"
]);
} else{
echo json_encode([
"Message" => "Sorry, there was an error uploading your file.",
"Status" => "Error"
]);
}
?>