Discussion board
How to store the uploaded file to the final location?
By
Uploading a file to different location using PHP...
Reply
Post   Reset
Teacher SiliconIndia replied to Monday, November 09, 2009
Hi Naveen,

Use move_uploaded_file function for this task.

Here is the syntax:

move_uploaded_file ( string filename, string destination)

This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.

If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued.