help needed in uploading

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

help needed in uploading

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.. :?
Post Reply