Page 1 of 1

upload files

Posted: Mon Feb 14, 2005 4:12 pm
by shiznatix
i have a section that uploads a file, but i want the file name to be changed when it is uploaded. here is what im using

Code: Select all

if (move_uploaded_file($_FILESї'thefile']ї'tmp_name'], "avatars/{$_FILESї'thefile']ї'name']}")){
	echo 'ok good';
	}else
	echo 'Could Not Be Uploaded';

Posted: Mon Feb 14, 2005 4:14 pm
by feyd
so change the name. :roll:

Posted: Mon Feb 14, 2005 4:15 pm
by shiznatix
so i would change

Code: Select all

avatars/{$_FILESї'thefile']ї'name']}
to

Code: Select all

avatars/customfilename
?

would this retain the file extension?

Posted: Mon Feb 14, 2005 4:21 pm
by feyd
try it, find out for yourself.