Note that in the form tag we use the enctype="multipart/form-data" attribute so that the browser knows that more than just text variables are coming at it.
We also have a hidden feild with the name name="MAX_FILE_SIZE" which set's the maximum file size in bytes that can be uploaded.
Now that we have the HTML form we create upload_file.php which actually uploads the file.
upload_file.php
For Windows based machine you have modify the path click here to get the windows example code file.
Common Error's The most common error is caused because write permissions are not set for the upload directory. In the above example assumes that you have the upload with proper write permissions.