Advertisement

09.30.2001 at 08:14AM PDT, ID: 20188578
[x]
Attachment Details

HELP!  I'm stumped on file upload problem.

Asked by KABOOM in PHP Scripting Language

Tags: , ,

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. The stuff i've tried in the copy statement (without success) are:
$DOCUMENT_ROOT/files/$doc
../files/$doc
home/wid/public_html/files/$doc

Any other ideas?


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("ERROR: 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 "ERROR: The following error occurred when updating the datab\
ase: ".mysql_error();
print "<BR>";
$error++;
}

return $error;
}Start Free Trial
[+][-]09.30.2001 at 10:50AM PDT, ID: 6514910

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.30.2001 at 03:06PM PDT, ID: 6515215

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.30.2001 at 10:18PM PDT, ID: 6515595

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.18.2001 at 08:07PM PDT, ID: 6545841

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: upload, file, doc
Sign Up Now!
Solution Provided By: nathan8
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32