473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Jun 6 '07 #1
1 3138
Rik
On Wed, 06 Jun 2007 22:02:02 +0200, wb*******@yahoo.com
<wb*******@gmail.comwrote:
<form enctype="mutlipart/form-data" method="post" action="<?php echo
mutlipart? I expect you mean multipart ;)

And why is the submit button not in your post array?
--
Rik Wasmus
Jun 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amy Kimber | last post by:
Hello all, ok, I have a file upload secton to my site, two pages, one with a form and one that does the uploading.... some files upload fine, other don't an exe of 300k will upload, but a...
3
by: Amy Kimber | last post by:
Hello, I have a file upload page, and I've had it working fine, it was beautiful :-) Anyway, the powers that be moved hosts... and it doesn't work now. The file name is correct, the directory...
1
by: Muttly | last post by:
Hey all. I'm trying to upload multiple files. I'm using the chm file from php.net to help me figure it out. I also checked online and say theres a problem with the file. Anyway My html looks like...
4
by: DH | last post by:
I have a "file upload form" that works OK, but I have been unsuccessful in my attempt to also resize the uploaded .JPG (if it is too wide), over-writing the original .JPG, and then create and save...
0
by: foekall | last post by:
I used this script and test on my hosting. Evertimes appear "change permission to 777 failed. ". So, how to solve this error. Please kindly check for me and teach me. <?php $MAX_SIZE =...
2
by: Event Horizon | last post by:
Hi, I'm trying to add an simple upload applet to shopping cart script. My new applet form sends all needed post fields ( quantity, product, etc... ) but the "file" post field is hardcoded in...
4
by: robin1983 | last post by:
Hi, i got a problem while uploading a file. I got a code from www.w3schools.com. I try the code, but the problem is that, i cannot specify the path where the file should stored. If i want to stored...
6
by: Milan Krejci | last post by:
while(list($key,$value) = each($_FILES)) { if(!empty($value)){ $filename = $value; $add = "upimg/$filename"; echo $_FILES; $error=copy($_FILES, $add); if (!$error)...
1
by: Dev | last post by:
Dear All, I want to upload a file with PHP script. For that i use code given below. with this code my operation success but there is no file on my Server/Website Anyone help me to solve this...
5
by: kailashchandra | last post by:
I am trying to upload a file in php,but it gives me error msg please Help me? My Code is like below:- i have one php file named upload.php and i have another html file named upload.html and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.