Be a Supporter!

PHP upload script problems... Help!

  • 823 Views
  • 3 Replies
New Topic Respond to this Topic
Pilot-Doofy
Pilot-Doofy
  • Member since: Sep. 13, 2003
  • Offline.
Forum Stats
Member
Level 37
Musician

Here is the error message I get while testing my PHP upload script: Warning: copy(/vcuploads/american nazi party.gif): failed to open stream: No such file or directory in /home/mustywin/public_html/subdomains/vietcong/downloads/upload.php on line 4
Could not copy file

Here is the code for the upload.php file which is the file that actually has all the coding to upload: <?php
if($file_name !="")
{
copy ("$file", "/vcuploads/$file_name")
or die("Could not copy file");
}
else {die("No file specified"); }
?>

What could be the problem? I didn't setup a database for the uploads but it didn't seem I needed to because it wasn't in the instructions. Do I have to? How would I specify the directories if I did have to?

Please help I need this script pretty quickly because visitors are getting annoyed with me haha. Test it yourself at http://vietcong.mustywindows.com/downloads/map_upload.php

Thanks.

Masculine
Masculine
  • Member since: Jun. 18, 2002
  • Offline.
Forum Stats
Supporter
Level 42
Artist
Response to PHP upload script problems... Help! 2004-05-09 09:29:42 Reply

Did you make the folder for the upload to got to and set all its attribute settings to 777?


BBS Signature
wikkiwakka
wikkiwakka
  • Member since: Dec. 4, 2002
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to PHP upload script problems... Help! 2004-05-09 10:18:28 Reply

There are a few things wrong with your code, I would suggest reading http://us4.php.net/manual/en/features.file-upload.php

:)

Pilot-Doofy
Pilot-Doofy
  • Member since: Sep. 13, 2003
  • Offline.
Forum Stats
Member
Level 37
Musician
Response to PHP upload script problems... Help! 2004-05-10 16:33:25 Reply

*bump* Does anyone know what's wrong? I've read the php tutorials but can't find it. :-(