Hey,
i've just got my ISP to change me over to a php5 server.
i had a uploading script i was currently working on and everything worked fine. however now when i try upload a file it errors
Warning: move_uploaded_file(/home/dontfoll/public_html/upload/guest/files/image/button9.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/dontfoll/public_html/upload/includes/uploadit.php on line 57
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpdVydvc' to '/home/dontfoll/public_html/upload/guest/files/image/button9.jpg' in /home/dontfoll/public_html/upload/includes/uploadit.php on line 57
ok i assumed that this was due to a configuration change. however it seems my php.ini is still the same?
now i fear it is failing to create the temp file?
can some please shed some light as to why this could be happening?
thanks
Edit
heres the code btw.. (its very incomplete (but did work..))
<?
define(USER_TYPE,'guest');
$type =$_POST['type'];
if (strlen($_FILES["userfile"]["name"])<=5)
{
throw_error(1,$type);
}
else
{
$filename = str_replace(" ","_",$_FILES["userfile"]["name"]);
$file_info = pathinfo($filename);
if ($file_info['extension'])
{
switch ($type) {
case "image":
if (in_array(strtolower($file_info['extension']),$image_extensions)
&& in_array($_FILES['userfile']['type'],$image_mime_types))
{
$uploadfile = $_SERVER['DOCUMENT_ROOT'].
'/upload/'.USER_TYPE.'/files/'.$type.'/'.$filename;
}
else
{
throw_error(3,$type);
}
break;
case "audio":
if (in_array(strtolower($file_info['extension']),$audio_extensions)
&& in_array($_FILES['userfile']['type'],$audio_mime_types))
{
$uploadfile = $_SERVER['DOCUMENT_ROOT'].
'/upload/'.USER_TYPE.'/files/'.$type.'/'.$filename;
}
else
{
throw_error(3,$type);
}
break;
case "video":
if (in_array(strtolower($file_info['extension']),$video_extensions)
&& in_array($_FILES['userfile']['type'],$video_mime_types))
{
$uploadfile = $_SERVER['DOCUMENT_ROOT'].
'/upload/files/'.USER_TYPE.'/'.$type.'/'.$filename;
}
else
{
throw_error(3,$type);
}
break;
}
if ($uploadfile)
{
if(!move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile))
{
thow_error(4,$type);
}else {echo 'File uploaded';}
}
}else{echo'im sorry..';}
}
?>