Page 1 of 1

help needed in uploading

Posted: Tue Feb 01, 2005 12:31 am
by itsmani1

Code: Select all

$uploaddir = "uploads"; 
if(is_uploaded_file($_FILESї'file']ї'tmp_name']))
{
move_uploaded_file($_FILESї'file']ї'tmp_name'],$uploaddir.'/'.$_FILESї'file']ї'name']);
}
here is some upload code and i need some of its explanation.
i.e.

if(is_uploaded_file($_FILES['file']['tmp_name']))
in this function:
'file' => name of file to upload and
'tmp_name' => ? for wot?
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
in this function i m not able to understand wot does it mean:'/'.$_FILES['file']['name'])

and my 2ns question is that:
is there any possiblity of creating folder using php?
if there is then how?

Posted: Tue Feb 01, 2005 12:51 am
by feyd
'file' is the name of the file upload field from the form
'tmp_name' is the temporary filename it has on the server's temporary folder.
the move_uploaded_file call specifies the path/filename to move to a new location, also giving it a new filename.

mkdir()

you may want to spend some quality time with the php manual function list.. :?