well i have tried move_uploaded_file as well but in this case i get Access Denied Error.
Ok here's the complete code
Code: Select all
$fname = $_FILES['tfile']['name'];
$pdfName = $_FILES['tfile2']['name'];
$the_path = "../../uploadimages/" . $fname;
$the_path_2 = "../../uploadimages/" . $pdfName;
if(copy($_FILES['tfile']['tmp_name'], $the_path))
{
if(copy($_FILES['tfile2']['tmp_name'], $the_path_2))
{
$UserID = $_SESSION['userid'];
$tdesc = addslashes($tdesc);
$iq = "insert into wenimage (gallery_id, sub_gallery_id, imagetitle, description, imagefile, pdffile, dateuploaded,user_id) values ($cboGallery, $cboSubGallery, '$ttitle', '$tdesc', '$fname', '$pdfName',NOW(), $UserID)";
$irs = wendbquery($conn, $iq);
$iq = "select max(imageid) from wenimage";
$irs = wendbquery($conn, $iq);
$idr = mysql_fetch_row($irs);
$newName = $dirPath . $idr[0] . $fname;
$newName2 = $pdfPath . $idr[0] . $pdfName;
rename($the_path ,$newName);
rename($the_path_2 ,$newName2);
}
On renaming the second file it says access denied...