Page 1 of 1

URGENT, PLEASE HELP !!

Posted: Wed Sep 24, 2003 1:15 pm
by nirma78
I am trying to upload a file in php, but it gives me this error :

Warning: move_uploaded_file(/home/httpd/htdocs/gbcb/): failed to open stream: Is a directory in /home/httpd/htdocs/gbcb/upload_app_files.php on line 26

Warning: move_uploaded_file(): Unable to move '/tmp/phpCaJbP9' to '/home/httpd/htdocs/gbcb/' in /home/httpd/htdocs/gbcb/upload_app_files.php on line 26


below is my code for this :

the location where my file is /home/httpd/htdocs/gbcb/upload.php
I am working on windows
the server is on another machine

PLEASE HELP !!

/**********************************************************/
<?php
$transcript = $_FILES['userfile']['name'][0];
$tmp_dest = $_FILES['userfile']['tmp_name'][0];
?>

<p><?php echo "transcript value : $transcript";?> </p>
<p><?php echo "temporary destination value : $tmp_dest"; ?> </p>
<?php
$up = move_uploaded_file($_FILES['userfile']['tmp_name'][0], '/home/httpd/htdocs/gbcb/');
var_dump($up);
if($up)
{
echo "File uploaded";
}
else
{
echo "Not uploaded";
}
?>

/**********************************************************/

Posted: Wed Sep 24, 2003 10:44 pm
by rterrar
The second parameter has to have the filename to move to. Not just the directory.

$up = move_uploaded_file($_FILES['userfile']['tmp_name'][0], '/home/httpd/htdocs/gbcb/filename');

Posted: Thu Sep 25, 2003 3:11 am
by twigletmac
Moved to PHP - Normal, it's not a database question.

Mac

Posted: Thu Sep 25, 2003 8:35 am
by nirma78
hey rterrar !!

Thanks for your help.

It worked !!