Rottingham Posted March 23, 2007 Share Posted March 23, 2007 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 More sharing options...
Rottingham Posted March 23, 2007 Author Share Posted March 23, 2007 NEVERMIND! Delete this post please moderators. the MAX_FILE_SIZE was too low and so the file wasn't being uploaded. Problem being, $_FILES["file"]["error"] was also blank, and PHP isn't outputting any warnings, so I had no way to know. Link to comment https://forums.phpfreaks.com/topic/43933-_files-upload-not-working/#findComment-213327 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.