In my case, I had to resize an image then uploaded as a normal file. Many sources suggest that in order for this php code to work:
$file = $_FILES['base_img_data'];
if($file['tmp_name']){
echo "FILE UPLOADED";
exit;
}
echo "FILE NOT UPLOADED";
Needs this form:
<form id="upload_form" method="post" action="..." enctype="multipart/form-data">
<input type="file" name="base_img_data" />
<button type="submit" id="savebtn" disabled>Save me</button>
</form>
But according to this stackoverflow answer I say NO you can upload using ajax, AFTER you process it.
Read more on Stackoverflow answer.