View Single Post

(#6 (permalink))
Old
dohlik dohlik is offline
Junior Member
dohlik is on a distinguished road
 
Posts: 4
Join Date: Jul 2008
Default 07-28-2008, 02:41 PM

this code works:
PHP Code:
// to upload file with path like '/uploads/dir1/dir2/'
$imgpath './uploads/'// this dir must be already exists with rights for writing
$imgpath.= 'dir1/';
mkdir($imgpath0777);
$imgpath.= 'dir2/';
mkdir($imgpath0777);
$cnt count($_FILES['f']['name']);
for (
$i=0$i<$cnt$i++)
    if (!
move_uploaded_file($_FILES["f"]["tmp_name"][$i], $imgpath.$_FILES["f"]["name"][$i]))
    { 
// some error!   }
.... 
Reply With Quote