Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@Prasad 007 Replace the below piece of code in doajaxfileupload.php and before that create folder "upload" inside folder "AjaxFileUploaderV2.1"</p> <pre><code>&lt;?php $error = ""; $msg = ""; $fileElementName = 'fileToUpload'; if(!empty($_FILES[$fileElementName]['error'])) { switch($_FILES[$fileElementName]['error']) { case '1': $error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; break; case '2': $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; break; case '3': $error = 'The uploaded file was only partially uploaded'; break; case '4': $error = 'No file was uploaded.'; break; case '6': $error = 'Missing a temporary folder'; break; case '7': $error = 'Failed to write file to disk'; break; case '8': $error = 'File upload stopped by extension'; break; case '999': default: $error = 'No error code avaiable'; } }elseif(empty($_FILES['fileToUpload']['tmp_name']) || $_FILES['fileToUpload']['tmp_name'] == 'none') { $error = 'No file was uploaded..'; }else { if (file_exists("upload/" . $_FILES["fileToUpload"]["name"])) { $msg .= $_FILES["fileToUpload"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "upload/" . $_FILES["fileToUpload"]["name"]); $msg .= "Stored in: " . "upload/" . $_FILES["file"]["name"]; $msg .= " File Name: " . $_FILES['fileToUpload']['name'] . ", "; $msg .= " File Size: " . @filesize($_FILES['fileToUpload']['tmp_name']); } //for security reason, we force to remove all uploaded file //@unlink($_FILES['fileToUpload']); } echo "{"; echo "error: '" . $error . "',\n"; echo "msg: '" . $msg . "'\n"; echo "}"; ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload