So you want to upload files using PHP? If so, then here’s a sample script on how to do it. Just copy it and paste it to a file named file_upload.php then change $upload_dir to your upload directory. Note that your upload directory should be writable otherwise, the file upload will fail.
Also, for simplicity, this script uses a single-file approach wherein the html form is placed in the same file where the PHP upload processing is made. You can separate these two sections into two different files if you wish – one for processing the upload in PHP and another for the HTML form but then you will have to make some changes to the script – I will leave that for you to find out.
Filename : file_upload.php*** Start Copying ***
*** End Copying ***
Post your questions, comments, suggestions, and other messages below.
I would like to link thios one with the one to resize an image.. ??? That would be perfect…