I accidentally put this in the install section of the forum. here is the same question as is posted there. Sorry for the redundancy...
I've gone through the forum looking for help on this one and have not been able to find a definitive response to this.
My hosting folks (god bless 'em) are running PHP 3.0.15. I'm told by them that I have permission to do this: I'm trying to put together a file uploading form.
I've gotten all the way to the copy($oldfile,$newfile) function.
i'm using the standard function workaround (from the php.net site) as follows:
function is_uploaded_file($filename) {
if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
/ User might have trailing slash in php.ini... /
return (ereg_replace('/+', '/', $tmp_file) == $filename);
}
and i'm calling it from this:
if (is_uploaded_file($userfile)) {
$newfile = basename($userfile);
copy($userfile, "/u/htdocs/uerid/images/".$newfile);
} else {
echo "Possible upload attack: filename '$userfile'.";
}
the error i get is this:
Warning: Unable to create '/images/phpAAA_CaqsH': No such file or directory in /u/htdocs/johnse/upload.php3 on line 25
Any ideas as to what is going on here?
Sorry to beat a dead horse with this problem, but I am at wit's end.
Thanks much!