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($imgpath, 0777);
$imgpath.= 'dir2/';
mkdir($imgpath, 0777);
$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! }
....