You are here: Re: file upload problem « PHP Programming Language « IT news, forums, messages
Re: file upload problem

Posted by FlungaBunga on 10/12/06 00:57

Hey,

Probably just look at the basics first.

you've selected the destination folder to be './ispit1', which is a
relative file path. I would recommend that you provide the script with
an absolute path to the destination so that regardless where you
execute your script from you'll be moving the files into the correct
folder. That'll make debugging the script much easier as you won't be
searching the file system for ispit1 folders ;)

Let us know how you go :)


On Oct 12, 10:01 am, "ljuljacka" <ljulja...@yahoo.com> wrote:
> I'm just trying to run a fileupload script from the manual, just to see how
> it works, and it won't. I've checked if file upload is enabled and it is.
> Also, the file I'm trying to upload is smaller then max. The folder I'm
> trying to upload files to is ./ispit1. I always get the "wrong" echo from
> the script when I run debug in my editor and when I run it in my browser
> (firefox) I get the following message:
> "The requested URL /ispit/__URL__ was not found on this server."
> The file isn't transfered to tmp directory either.
> Any help is welcome.
>
> <form enctype="multipart/form-data" action="__URL__" method="POST">
> <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
> Send this file: <input name="userfile" type="file" />
> <input type="submit" value="Send File" />
> </form>
>
> <?php
> $uploaddir = './ispit1/';
> $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
>
> if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
> echo "File is valid, and was successfully uploaded.\n";} else { echo "Possible file upload attack!\n";}?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация