Uploading Files with PHP

Uploading Files with PHP How to upload files on server using a Simple HTML form and PHP. You can upload any type of file like images, videos, ZIP files, Office documents file, PDFs and other supported file types. Crating a HTML form to upload the file : <form method=’post’ enctype=’multipart/form-data’ action=’upload.php’> File: <input type=’file’ name=’file_upload’> <input type=’submit’> </form>   PHP SCRIPT to upload file : <?php // Check for errors if($_FILES[‘file_upload’][‘error’] > 0){ die(‘An error ocurred when uploading.’); } if(!getimagesize($_FILES[‘file_upload’][‘tmp_name’])){ die(‘Please ensure you are uploading an image.’); } // Check…

Read More