This is a discussion on File upload within the PHP General forums, part of the PHP Programming Forums category; I want to upload some file to my web site. I'm using this script: <html> <head&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I want to upload some file to my web site.
I'm using this script: <html> <head> <title>Upload Form</title> </head> <body> <form action="upload_single.php" method="post" enctype="multipart/form-data"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="102400"> Upload a file: <input type="file" name="thefile"><br><br> <input type="submit" name="Submit" value="Submit"> </form> </body> </html> The upload_single.php script is just this: <?php $ime = $_FILES["thefile"]["name"]; print ($ime); ?> I just want for begining to print the name of file. But It doesn't work. Operating system is Linux. Web server is Apache. Can anyone help me. Greetings! Peda. |
|
|||
|
Peda wrote:
> I want to upload some file to my web site. [snip] > But It doesn't work. Do you have file uploads enabled in php.ini? Take a look at a phpinfo() page for details. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com |
|
|||
|
>The upload_single.php script is just this:
><?php > $ime = $_FILES["thefile"]["name"]; > print ($ime); >?> >I just want for begining to print the name of file. >But It doesn't work. Do you get anything if you change "name" to "tmp_name" to beging with? If I'm not mistaken ,"name" isn't filled in with anything unless You've used move_uploaded_file() first. Also check if uploads are enabled in php.ini. Oh, and if you have permissions to write in The tmp directory as well. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 |
|
|||
|
Peda wrote:
> I want to upload some file to my web site. > > The upload_single.php script is just this:> <?php > $ime = $_FILES["thefile"]["name"]; > print ($ime); > > I just want for begining to print the name of file. > But It doesn't work. did you look what comes from your form? try: var_export($_FILES); |
|
|||
|
* Thus wrote Peda (ena-mona@eunet.yu): > I want to upload some file to my web site. > > I'm using this script: Please Read: http://us3.php.net/manual/en/features.file-upload.php Curt -- "I used to think I was indecisive, but now I'm not so sure." |