PHP File Upload Problem

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

 



I have a problem uploading files with PHP which has me stumped!  I am unable
to successfully upload files.  My simple test script is as follows:

<?php

    if (count($_FILES))
    {
        var_dump($_FILES) ;
    }

    if (is_uploaded_file($_FILES['toProcess']['tmp_name']))
    {
        print "<h3>File successfully upload.</h3>" ;
        print "<a href=\"{$_SERVER['PHP_SELF']}\">Try again?<br>" ;
    }
    else
    {
         print <<< __RAWHTML__
<form enctype="multipart/form-data" action="{$_SERVER['PHP_SELF']}"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="10240000">
Filename:  <input name="toProcess" type="file">
<input type="submit" value="upload">
</form>
__RAWHTML__;
         print "<br><a href=\"{$_SERVER['PHP_SELF']}\">Try again?<br>" ;
    }

?>


When I run it I get the following back:

array(1) { ["toProcess"]=> array(5) { ["name"]=> string(12) "100_2038.JPG"
["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(1)
["size"]=> int(0) } }

Obviously I have some sort of error as my "tmp_name" key is null and the
"error" key is 1.

Any ideas or suggestions?  I am running IIS with PHP 4.3.4.  I checked my
php.ini file and the settings for uploading files look good to me:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; 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 = c:\windows\temp

; Maximum allowed size for uploaded files.
upload_max_filesize = 1G

Thanks for any help or suggestions.

Mike


-- 
Mike Walsh - mike_walsh at mindspring.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