You are here: Re: [PHP] Uploading a File « PHP « IT news, forums, messages
Re: [PHP] Uploading a File

Posted by Dotan Cohen on 10/04/57 11:09

On Sat, 26 Feb 2005 23:04:59 -0700, Jason Bennett <jason@gcftech.com> wrote:
> Hi all,
>
> I'm having this problem trying to upload a file using PHP. I am using
> Apache (compiled from source) and PHP 5.0.3
>
> The entire contents of the page is:
>
> <form method="post" enctype="multipart/form-data" action="/upload.php">
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="52428800">
> <input type="file" name="myfile">
> <input type="submit" value="Begin Upload">
> </form>
>
> The entire script is:
>
> <?php
>
> $uploaddir = "/tmp";
> $uploadfile = $uploaddir . "uploaded.file";
>
> if (move_uploaded_file($_FILES['myfile']['tmp_name'], $uploadfile))
> {
> echo "Complete.";
> }
> else
> {
> echo "No Upload.";
> }
>
> ?>
>
> The returned message I get is:
>
> Notice: Undefined index: myfile in /www/htdocs/upload.php on line 6
> No Upload.
>
> I've checked $_FILES['myfile']['error'] and its empty. The whole
> $_FILES array is empty. In my php.ini file I have the following:
>
> ; Whether to allow HTTP file uploads.
> file_uploads = On
>
> ; Temporary directory for HTTP uploaded files (will use system default
> if not
> ; specified).
> upload_tmp_dir = /tmp
>
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 50M
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


You might want to just use my TerribleFile script:
http://dotancohen.com/terriblefile

Even if you don't use it, you can look at the code for ideas. Enjoy.

Dotan Cohen
http://English-Lyrics.com
http://Song-Lyriks.com

 

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

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