Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move a file to another directory

Status
Not open for further replies.

justride

Programmer
Jan 9, 2004
251
US
How can I move a file from on directory to another?
Code:
$original = file('/home/christ/public_html/ASC/tmpeqtfiles/'.$file);
				$new = '/home/christ/public_html/ASC/eqtfiles/'.$file;
move_uploaded_file($original,$new);
this isnt moving the file
 
First, move_uploaded_file() takes as its parameters two strings filenames (see You're passing a string an an array.

Second, move_uploaded_file() only works on files that have just been uploaded during that run of the script. If the source file is not an uploaded file, I recommend you look at rename()

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top