RE: [PHP] Brainfart while uploading <-- SOLVED -- Sorry ;)
| From: | César Aracena | Date: | Tue, 10 Sep 2002 04:31:34 +0000 |
| Subject: | RE: [PHP] Brainfart while uploading <-- SOLVED -- Sorry ;) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115816@lists.php.net to get a copy of this message | ||
The only brain cells I've got awake at this moment figure out that when
copying an upload form/code the "enctype" must be copied as well...
sorry for this. I had some more trouble, but it was solved by giving the
appropriate permissions to the folder.
Thanks again, C.
> -----Original Message-----
> From: César Aracena [mailto:icaam@icaam.com.ar]
> Sent: Tuesday, September 10, 2002 1:04 AM
> To: PHP General List
> Subject: [PHP] Brainfart while uploading
>
> Hi all.
>
> I just saw my code laugh at me when this exploded into my face. Can
> anyone tell me why isnt this working? I just copied it from another
> page made by me for the same site, changed the parameters and tested
it,
> but it doesnt work here
hows this possible?
>
> ****************BEGIN CODE*******************
> if (is_uploaded_file($_FILES['revpic']['tmp_name'])){
> copy($_FILES['revpic']['tmp_name'],
> "/usr/local/www/virtual1/66/175/7/45/html/revpics");
> echo "Review's picture uploaded successfully<br>";
> $query = "INSERT INTO saav_reviews VALUES (NULL, '$revdate',
'$revname',
> '$revrev', ".$_FILES['revpic']['tmp_name'].")";
> $result = mysql_query($query) or die (mysql_error());
> if (!$result){
> //Do Things
> }
> else if ($result){
> //Do Things
> }
> }
> else if (!is_uploaded_file($_FILES['revpic']['tmp_name'])){
> $query = "INSERT INTO saav_reviews VALUES (NULL, '$revdate',
'$revname',
> '$revrev', NULL)";
> $result = mysql_query($query) or die (mysql_error());
> if (!$result){
> //Do Things
> }
> else if ($result){
> //Do Things
> }
> }
> ****************END CODE*******************
>
> What bothers me, is that I pointed this file to my phpinfo.php and got
> an empty array, so theres no [tmp_name] anywhere
hows that
possible?
> And the obvious result, is that the code pass right through to the
else
> if (!is_uploaded_file
instead of stopping at the if decision, and
> stores everything but the uploaded image ¿anyone?
>
> Thanks in advance,
>
> <mailto:webmaster@icaam.com.ar> Cesar Aracena
> On Dial-Up
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>