...

View Full Version : $_FILES is empty!



Bobafart
03-02-2008, 10:37 PM
can't upload files.. can someone help pls?



<?php

if (isset($_POST['createUserGroup_x'])) {

echo 'this output displays when the form is submitted';

var_dump($_FILES); // this is empty -- why? I uploaded a file which was only 12 kb!

if(isset($_FILES['uploadedfile']['name'])){

echo 'nothing in here outputs because $_FILES is empty';

}

echo 'the remainder of my form outputs down here';

}
// what am I doing wrong?
?>


<form action="" method="post" id="commentform" name="commentform">

<input type="hidden" name="MAX_FILE_SIZE" value="100000" />

<input type="file" name="uploadedfile" size="30" />

<input id="createUserGroup" name="createUserGroup" type="image" src="/img/icons/icon_submit.gif" />

</form>

Bobafart
03-02-2008, 10:39 PM
gah! I am so stupid!!!!

enctype="multipart/form-data"

how could I forget this???

sleep helps...

digitalfiz
03-02-2008, 10:59 PM
Everyone makes mistakes :P Just most of the time we catch them before we post questions on them :P



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum