Tag Archives: file upload

PHP

PHP Secure File Upload Script

This article provides a simple php secure file upload and validation function. As a web developer security should be a top priority. This is never more important than when allowing the upload of files to the server as the scope to initiate an attack increases greatly without the proper checks in place. Below is a function that can be used to upload files to your server in a secure manor. Only files that have a valid extension and MIME type and that are below a set size limit can be uploaded. For added security when uploading images you can also check that the file is a valid image. And finally, you can randomise the file name to further increase security.
Continue Reading