I am trying to upload files to uploads folder with this code: Upload multiple image using AJAX, PHP and jQuery
In this post, what is the correct way to upload the files to uploads
folder
This is what i have but doesn't upload the files:
if (isset($_POST["file"])) {
// do php stuff
move_uploaded_file($_FILES['file']['tmp_name'], "uploads/".$_FILES['file']['name']);
// call `json_encode` on `file` object
$file = json_encode($_POST["file"]);
// return `file` as `json` string
echo $file;
};
The php code is in the same file at the top where also the form and drop area is