PHP - Temp File Path is null -
i have script handles file uploads. have uploaded files under 1 mb, when file on 1 mb script seems set temporary file path null. here script below:
$total = count($_files['docname']['tmp_name']); for($i = 0; $i < $total; $i++) { // temp file path $tmpfilepath = $_files['docname']['tmp_name'][$i]; // check if have path if ($tmpfilepath != "") { // variables form $foldername = $_post['foldername']; $foldername = stripslashes($foldername); $foldername = mysql_real_escape_string($foldername); //setup our new file path // check if folder name home, if so, set file path folder if ($foldername == "home") { $target_dir = "../../cdn.brmbc.com/usercontent/".$userid."/"; } // if folder name not home, make file go folder else { $isinfolder = 1; $target_dir = "../../cdn.brmbc.com/usercontent/".$userid."/".$foldername."/"; } $target_file = $target_dir . basename($_files["docname"]["name"][$i]); $filetype = pathinfo($target_file,pathinfo_extension); $documentname = $_files["docname"]["name"][$i]; echo $tmpfilepath . "<br>"; echo $target_file . "<br>"; echo $filetype . "<br>"; echo $documentname . "<br>"; } // go home if there no temp path else { echo $tmpfilepath . "<br>" . "failed upload"; } }
does there appear incorrect code, or server issue?
if uploads work files under 1mb i'm guessing it's php.ini setting.
if have access php.ini search setting called "max_file_uploads" - bet it's set 1mb.
Comments
Post a Comment