i've read php.net, phpbuilder.com scripts, my several php scripting books and countless random websites for source codes on how to simply upload a file and nothing is working...
all i want here is the most basic code to upload a file and here is what i have at this point...many many attempts later:
<?php
if($userfile)
{
$uploaddir = "hidden";
echo "File...<br>";
echo "$userfile...<br>";
echo $userfile_name;
echo "Destination...<br>";
echo "$uploaddir...<br>";
if(copy($userfile, $uploaddir . $userfile_name))
{
echo "Success";
}
}
?>
<form action="<?php echo $PHP_SELF ?>" method="post" name="upload">
File to Upload: <input type="file" name="userfile"><BR>
<input type="submit" value="Upload">
</form>
i put in echos to try to debug what is going on; as far as i can tell the script is breaking on this line:
if(copy($userfile, $uploaddir . $userfile_name))
with the following error message:
Warning: copy(D:\images\someimage.gif) [function.copy]: failed to create stream: No such file or directory in /home/user/public_html/upload.php on line 41
any suggestions or answers?