- Nov 14, 2011
Now that your scripts are all prepared, you should be able to access the form page from your web server and upload files to the uploads folder. If your script is not working as you expect, you can use troubleshooting tools, such as Firebug, to help you to isolate the issue. The most common issue with file uploads is that the maximum file size is not defined properly in the form or that the uploads folder does not have the right permissions. The PHP script must have permissions to write to the folder.
Once you have the script working, you can then start to apply some validation procedures to the files to make sure that users are not uploading malicious files to your web server. There are several other improvements you can make to the upload script, including testing that the files actually ended up on the server using jQuery’s AJAX methods or adding a progress bar. The code is modular and can be used over and over again in your web projects and modified to handle complex upload operations.