473,834 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Empty $_FILES array??!?!

Can someone else see immediately why this script:

<html>
<body>
<?php
error_reporting (~E_ALL);
print_r($_FILES );

print_r($_POST) ;

print_r($_REQUE ST);

?>
<form name="form" action="<?php echo $_SERVER['PHP_SELF'] .
'?processed=1'; ?>" method="post">
<input type="hidden" name="MAX_FILE_ SIZE" value="5000000"/>
<input type="file" enctype="multip art/form-data" name="thefile"/>
<input type="submit"/>
</form>
</body>
</html>
Causes this output:

Array
(
)
Array
(
[MAX_FILE_SIZE] => 5000000
[thefile] => archivedir.sh
)
Array
(
[processed] => 1
[MAX_FILE_SIZE] => 5000000
[thefile] => archivedir.sh
[PHPSESSID] => e7aa5c556db6b28 6a8eca8704b58a4 de
)

When file_uploads, upload_max_file size, upload_tmp_dir, post_max_size
and max_input_time are set to appropriate values in php.ini (php5.1.2)?
Driving me nutso.

Apr 6 '06 #1
2 3716
"chris" <cf*******@gmai l.com> wrote in message
news:11******** *************@j 33g2000cwa.goog legroups.com...
Can someone else see immediately why this script:

<html>
<body>
<?php
error_reporting (~E_ALL);
print_r($_FILES );

print_r($_POST) ;

print_r($_REQUE ST);

?>
<form name="form" action="<?php echo $_SERVER['PHP_SELF'] .
'?processed=1'; ?>" method="post">
<input type="hidden" name="MAX_FILE_ SIZE" value="5000000"/>
<input type="file" enctype="multip art/form-data" name="thefile"/>
<input type="submit"/>
</form>
</body>
</html>


The enctype="multip art/form-data" is supposed to be an attribute of the
form, not the file field.

Like so:
<form name="form" action="<?php echo $_SERVER['PHP_SELF'] .
'?processed=1'; ?>" method="post" enctype="multip art/form-data">
<input type="hidden" name="MAX_FILE_ SIZE" value="5000000"/>
<input type="file" name="thefile"/>
<input type="submit"/>
</form>

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi. net | Gedoon-S @ IRCnet | rot13(xv***@bhg byrzcv.arg)
Apr 6 '06 #2
D'oh. Thank you.

Apr 6 '06 #3

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

Similar topics

0
7728
by: mrbog | last post by:
All I did was recompile my PHP 4.3.4 with the included GD and now my $_FILES is perpetually empty. My php app is identical, I haven't changed it at all since recompiling. I tried recompiling again without GD to fix the problem, to go back to what I had before, but $_FILES is always empty. I can't imagine that I'm doing something so out of the ordinary, and yet I'm unable to google for someone with the same problem. I am running...
6
2377
by: lawrence | last post by:
I've the form you see below, which is supposed to upload an image. I expect the image name as a var to be $uploadedFile. In the receiving function, I've this code: global $uploadedFile, $uploadedFile_size, $uploadedFile_name; echo "here is the file name: $uploadedFile, $uploadedFile_size, $uploadedFile_name; <hr> "; $uploadedFile_name = $formatTextObject->processFileName($uploadedFile_name); $uploadedFile_name =...
4
3458
by: Ian.H | last post by:
Hi all, Uploading of files.. AFAIU from the manual, if a file is larger than the size defined in the form or larger than upload_max_filesize in php.ini, that _FILES should hold an INT error code. The file upload system is working fine if the file is smaller than the defined size, but if it's larger, then both the _POST and _FILES arrays are completely empty:
1
2639
by: Bob Bedford | last post by:
I've a function asking for a $_FILES argument: function insertarticle($particle,......,$pUserID,$pOptions,$files){ in this function I do add the record and then save the files in a subdirectory specific on some datas. This function is used by my "insert" form, letting the user to select images files to upload with <FILE> html tag. The files to upload are then passed to the $files like this:...
3
3931
by: Bob Bedford | last post by:
I'm passing the code from $_POST to $_GET. I've a page upload using $_FILES. when the page was in $_POST, it worked fine, but now, in $_GET, the $_FILES is empty. any idea ?
8
3493
by: mpar612 | last post by:
Hello, I am a newbie to PHP, MySQL. I am trying to create a basic file upload form. I want to get that working and then I want to integrate that into a form that will rename the file and save it to a directory and store the path to the file in the db, in addition to storing other text from other fields in the form. Then I will get that path using PHP to display the image file in a browser. First things first, I'm having difficulty...
9
3207
by: Arthur Jacobs | last post by:
Good Day, I can upload a file as long as it is empty (thanks Hendri Kurniawan). I do not know where to look. Can someone help me understand what I need to do to upload a small image. http://chops.novatrope.com/game/test/upload_file3.php Here is some more info http://chops.novatrope.com/info.php
2
2224
by: daav31 | last post by:
Hello, I have the following code: $RecordID = $_POST; $LastModBy= $_POST; // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format
3
9389
Markus
by: Markus | last post by:
Ok, so i'm doing the multiple file upload thingymabob! I'm just playing around really... When i try to check the file type i simply get Array(). foreach ($_FILES as $_key => $_value) { echo $_value . " was uploaded successfully.<br />";
0
9799
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9646
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10793
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10510
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6954
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5627
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.