Re: File Upload
| From: | Philip Murray | Date: | Mon, 30 Jul 2001 00:44:37 +0000 |
| Subject: | Re: File Upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60133@lists.php.net to get a copy of this message | ||
Quoting Gerard Samuel <trini0@optonline.net>:
> Hey all, Im running freebsd 4.3, apache 1.3.20, mysq.3.23.39, php 4.0.6.
> Im trying to figure out file uploading.
> If I echo $pic, $pic_name, $pic_size, $pic_type, after the form is
> submitted, everything echoes correctly.
>
> In my script I have ==>
> $archive_dir = "/files/www/data/archive";
> $filename = basename($pic_name);
> if (!copy($pic, "$archive/$filename"))
Shouldn't that be
if( !copy( $pic, "$archive_dir/$filename" ) );
> echo "Error: $filename cannot be uploaded.";
> else echo "Successfully uploaded $filename.";
>
> When I submit the form, it outputs ==>
> Error: Dscf0005.jpg cannot be uploaded.
>
> I chmoded the folder to 777 and still the same results.
>
It's always the simple things. :)
--
-------------------------------- - -- - - -
Philip Murray - webmaster@open2view.com
http://www.open2view.com - Open2View.com
------------- - -- - -