I have this function that inserts a bunch of stuff into a database (ie: File name) and copies the file to a directory on my Linux box.
I keep getting an error at the copy statement and i'm stumped. Any help would be much appreciated. The error i'm getting is:
Warning: Unable to open 'C:\Documents and Settings\myuen\Desktop\t1.doc' for reading: No such file or directory in
/home/wid/public_html/cgi-bin/AgendaModificationCheck.php on line 25
I know my directory exists and i'm actually using basically the same script as I did on my other file upload pages - so I know the directory is writable since other pages can write to it.
function insertion($time, $hour, $agenda, $speaker, $doc, $file, $confid)
{
$filepath = "/home/wid/public_html/files";
print "$doc is file<BR>";
if(!empty($doc))
{
copy($doc, "$filepath/$doc") or
die("<B>ERROR:</b> An error occurred when uploading $file<BR>");
}
$insertq = "INSERT INTO confdetails SET time='$time', hour='$hour', agenda='$agen\
da', participants='$speaker', documents='$file', confid='$confid'";
$insertresult = mysql_query($insertq);
if(!$insertresult)
{
print "<B>ERROR:</b> The following error occurred when updating the datab\
ase: ".mysql_error();
print "<BR>";
$error++;
}
return $error;
}