can't upload file to $_FILES

This is a discussion on can't upload file to $_FILES within the PHP General forums, part of the PHP Programming Forums category; I'm trying to figure out why I can't upload a file in php. I'm trying it locally ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-06-2007
wbsurfver@yahoo.com
 
Posts: n/a
Default can't upload file to $_FILES


I'm trying to figure out why I can't upload a file in php.
I'm trying it locally on a windows XP machine running Apache 2.2 and
PHP 5.2.1.
That is I am running the browser/server on same machine to test with.
I also tried it on a remote linux server, though in that case I'm not
sure what the s
config settings where, except that it does have PHP and I get the same
results.

Are there any releevant apache settings ? I have not come accross any.


Below is my script, results, and config settings.


=------------------------------------------------------

<html>

<body>

<?php

if ($_SERVER['REQUEST_METHOD'] == 'GET') { ?>
<form enctype="mutlipart/form-data" method="post" action="<?php echo
$_SERVER['SCRIPT_NAME'] ?>" >
<input type="file" name="document"/>
<input type="submit" value="Send File"/>
</form>
</body>
</html>
<?php }
else
{
echo "FILE=";
print_r($_FILES);
echo "</br></br>POST=";
print_r($_POST);
}

--------------------------------------------------------

on a post I get an empty $_FILES object and something in the $_POST
variable from the above prints:

FILE=Array ( )

POST=Array ( [document] => feedblitz.txt )


# my php config file has these settings which I also verified with
phphinfo()

; 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:\play\soaptest";

; Maximum allowed size for uploaded files.
upload_max_filesize = 5M

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:41 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0