I have this problem on my file upload. I try to upload my PDF file while checking on validation the TMP_NAME is empty and when I check on $_FILES['document_attach']['error'] the value is 1 so meaning there's an error.
But when I try to upload other PDF file it's successfully uploaded. Why is other PDF file not?
HTML
<form action="actions/upload_internal_audit.php" method="post" enctype="multipart/form-data"> <label>Title</label> <span><input type="text" name="title" class="form-control" placeholder="Document Title"></span> <label>File</label> <span><input type="file" name="document_attach"></span><br> <span><input type="submit" name="submit" value="Upload" class="btn btn-primary"></span> </form> PHP
if(isset($_POST['submit'])){ $title = $_POST['title']; $filename = $_FILES['document_attach']['name']; $target_dir = "../eqms_files/"; $maxSize = 5000000; if(!empty($title)){ if(is_uploaded_file($_FILES['document_attach']['tmp_name'])){ if ($_FILES['document_attach']['size'] > $maxSize) { echo "File must be: ' . $maxSize . '"; } else { $result = move_uploaded_file($_FILES['document_attach']['tmp_name'], $target_dir . $filename); mysqli_query($con, "INSERT into internal_audit (id, title, file) VALUES ('', '".$title."', '".$filename."')"); echo "Successfully Uploaded"; } }else echo "Error Uploading try again later"; }else echo "Document Title is empty"; } 



1isUPLOAD_ERR_INI_SIZE: The uploaded file exceeds theupload_max_filesizedirective inphp.ini. You might need to restart apache or php-fpm to use newphp.inisettings.