Re: Uploading a File

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 26 Feb 2005 23:04:59 -0700, Jason Bennett <jason@xxxxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux