Folks
I cant get file uploads to work in php.
Heres my script.
<HEAD<TITLE>Picture Uploads</TITLE></HEAD>
<BODY>
<?if(!$userfile) { ?>
<FORM ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF; ?>"
METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="500000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>
<? } else {
$dest =
"$DOCUMENT_ROOT/".dirname($PHP_SELF)."uploads/$userfile_name";
echo "<p> Dest is $dest.</p>";
echo "<p>File in temp directory is $userfile</p>";
if(copy($userfile,$dest)!=0) {
echo "Unable to create $dest - check permissions<br>\n";
exit;
}
unlink($userfile);
echo "<p>File copied to $dest</p>";
}
?>
</BODY>
This gives me file permission errors, i.e. here's the output.
Dest is /usr/htdocs/uploads/1pix.gif.
File in temp directory is /www/phptmpdir/php1QPFF2
Warning: SAFE MODE Restriction in effect. The script whose uid is 2373
is not allowed to access /www/phptmpdir/php1QPFF2
owned by uid 99 in /www/martinhull.uklinux.net/pic_upload.php3 on line
13
Warning: SAFE MODE Restriction in effect. The script whose uid is 2373
is not allowed to access /www/phptmpdir/php1QPFF2
owned by uid 99 in /www/martinhull.uklinux.net/pic_upload.php3 on line
17
File copied to /usr/htdocs/uploads/1pix.gif
Can you help? What is SAFE MODE restriction?
ta
Martin