JDT |
FREE Downloads |
|
Creating a Simple File Uploader Using PHP - Part 5 |
||||
|
In this series of tutorials we will look at how to develop a simple file uploader using PHP. All of the code is freely available for download (License: GNU GPL) from this link: Download File Uploader. In this tutorial we will look at how the file uploader can be adapted so that it can be used by other users to upload files to your web site. The file uploader we have developed in this series of tutorials can only be used by someone who knows the connection details (host, username, etc) of the server that you want to upload a file to. You could, however, very easily adapt the uploader so that it could be used by ordinary visitors to your web site, enabling them to upload files. To do this, instead of prompting for the connection and storage location details (username, password, etc) on the upload form, you could hardcode these details into the form handler. This would mean of course that the uploaded files were always stored in the same folder, but that's probably what you want anyway. The form handler already contains some security code to check the uploaded file, which you don't need if you are the only person uploading files, but you do if you're letting other people upload files to your site. TroubleshootingThe area that is most likely to cause problems is the 'target folder' definition. If you receive error messages saying that the target folder does not exist, try removing the code (from fileUploader.php) that sets the file permissions (it is labelled in the script). If you do this, you will have to set the file permissions manually, but it will make it easier to resolve any folder path issues. Go back to PHP Tutorials home page Go back to Tutorials home page
|