How to upload a file in php with php validation of extension?
Simply copy and paste this code on your page And your input file name will be uploadedfile Like <input type="file" name="uploadedfile" /> and on submit of this page you will add this code $youruniqueid could be anything like userid or projected on the basis of this it will create folder for image upload $projId=$youruniqueid; if(!empty($_FILES['uploadedfile']['name'])){ $imgExtension = array("jpg","jpe","jpeg","gif","png","GIF","JPG","JPEG","txt","pdf","PDF","docx","xlsx","pptx","pptm","doc","dot","xls","ppt"); $image_name = pathinfo($_FILES['uploadedfile']['name']); $extension = strtolower($image_name['extension']); if(in_array($extension,$imgExtension)){ $file_name = $_FILES['uplo...