Jump to content

$_FILES Upload not working...


Rottingham

Recommended Posts

Ok, I have a very basic upload form and script, and I am getting nothing! At first, when I had MAX_FILE_SIZE set to 720000 it wouldn't get set $_FILES. After I backed that down to 10000 it sets the file name, but not tmp_name, size or type. Only name gets the file name. However, with no tmp_name I can't use is_uploaded_file().

 

<form name="add_pic" action="people.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="10000" />
<input type="hidden" name="view" value="" />
<input type="hidden" name="cat" value="6" />
Please choose the image you wish to assign to [NAME].<br /><br />
<input type="file" name="file" /><br>
<input type="submit" name="submit" value="Upload File" />
</form>

 

Then, my upload script

 

function add_pic()
{
   if(isset($_REQUEST["submit"]))
   { 
       echo "Path: ".$_FILES["file"]["tmp_name"]."<br />";
       echo "Name: ".$_FILES["file"]["name"]."<br />";
       echo "Type: ".$_FILES["file"]["type"]."<br />";
       echo "Size: ".$_FILES["file"]["size"]."<br />";
   }
   else
      // SHOW FORM
}

 

 

The result I get is this:

 

Path:

Name: aardvark.jpg

Type:

Size: 0

 

 

Link to comment
https://forums.phpfreaks.com/topic/43933-_files-upload-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.