?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?File Upload Problem
Author:??(---.nyc.rr.com)
Date:???02-17-04 10:09

I've been trying to upload a file to my server via a web form. Here is my code...

----------------------------

$photopath = "/usr/home/web/users/12345ABC/photos/";
$thename = "1_3";

if ($file1)
{
$namedfile = $thename."a.jpg";
$fileonserver = $photopath."".$namedfile;
copy($file1, "$fileonserver");
unlink($file1);
$photo1 = $namedfile;
}

----------------------------

However, I keep getting the following error:

----------------------------

Warning: copy(C:\\Documents and Settings\\Desktop\\2222_1111.jpg): failed to open stream: No such file or directory in /usr/home/web/users/12345ABC/section/page.php on line 551

Warning: unlink(C:\\Documents and Settings\\Desktop\\2222_1111.jpg): No such file or directory in /usr/home/web/users/12345ABC/section/page.php on line 552

----------------------------

"No such file or directory" ? The images open fine on my desktop. Not sure what's going on... I had the code working earlier before I changed a bunch of things, so I know the path and folder permissions are fine. Any ideas?

?Topics Author? Date
?File Upload Problem??new
Jabbamonkey 02-17-04 10:09?
?Re: File Upload Problem??new
Jabbamonkey 02-17-04 18:11?
?Re: File Upload Problem??new
sayma 03-03-04 20:37?
?Re: File Upload Problem??new
Jabbamonkey 03-04-04 05:24?
?Re: File Upload Problem??new
sayma 03-06-04 20:35?
?Re: File Upload Problem??new
sayma 03-07-04 19:40?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > I've been trying to upload a file to my server via a web > form. Here is my code... > > ---------------------------- > > $photopath = "/usr/home/web/users/12345ABC/photos/"; > $thename = "1_3"; > > if ($file1) > { > $namedfile = $thename."a.jpg"; > $fileonserver = $photopath."".$namedfile; > copy($file1, "$fileonserver"); > unlink($file1); > $photo1 = $namedfile; > } > > ---------------------------- > > However, I keep getting the following error: > > ---------------------------- > > Warning: copy(C:\\Documents and > Settings\\Desktop\\2222_1111.jpg): failed to open stream: No > such file or directory in > /usr/home/web/users/12345ABC/section/page.php on line 551 > > Warning: unlink(C:\\Documents and > Settings\\Desktop\\2222_1111.jpg): No such file or directory > in /usr/home/web/users/12345ABC/section/page.php on line 552 > > ---------------------------- > > "No such file or directory" ? The images open fine on my > desktop. Not sure what's going on... I had the code working > earlier before I changed a bunch of things, so I know the > path and folder permissions are fine. Any ideas? ">??

Provided By
Phorum