Welcome Guest, Not a member yet? Register   Sign In
SOLVED: where are my $_FILES
#1

[eluser]vevmesteren[/eluser]
Good evening all

I am starting to get seriousely desperate here. A form that was working perfectly fine stopped working. And I cannot for the life of it, figure out why that is. I am running the last version of CI. I have a form (normally it is huuge, but in an effort to find out wtf is wrong I have cut it down a lot.


Code:
<?=form_open_multipart('inscription/addUser'); ?>
<tr>
    <td colspan='2'>Files</td>
</tr>
<tr>
    <td>Some data: </td>
    <td>
&lt;input type="file" name="audiofile" size="20"&gt;</td>
</tr>

<tr>
    <td colspan='2'>&lt;input type="submit"&gt;</td>

</tr>

&lt;/form&gt;

when I then
Code:
var_dump($_FILES)
I get zilch, nada nothing. As in:
Code:
array(0) { }
. Why is that? It was working perfectly fine before.

oh yes before I forget here my library load script:
Code:
$config['upload_path'] = './uploads/';
            $config['allowed_types'] = 'jpg|mp3|avi|mov|m4a';
            $config['remove_spaces'] = TRUE;
            $config['max_size'] = '1000000';
                
            $this->load->library('upload', $config);

PHP info tells me that file_uploads are 'on'
#2

[eluser]coolfactor[/eluser]
2 questions:
- At what point during the upload are you using var_dump($_FILES)?
- can we see the actual source code of the generated form? That might reveal something.
#3

[eluser]vevmesteren[/eluser]
The form:

Code:
&lt;form action="http://localhost/index.php/inscription/addUser" method="post" enctype="multipart/form-data"&gt; <tr>
    <td colspan='2'>Files</td>
</tr>
<tr>
    <td>Some data: </td>
    <td>
&lt;input type="file" name="audiofile" size="20"&gt;</td>
</tr>

<tr>
    <td colspan='2'>&lt;input type="submit"&gt;</td>

</tr>

&lt;/form&gt;

the var_dump I call in the addUser function.

I have been reading up in the meantime and have found something about missing space, but that is not the case, there is like 12GB free. Next I have found some info about checking my tmp driver. But there I am at a loss. I am running a basic LAMP installation on my Ubuntu, I checked my tmp folder, but that contains a few hundred ks at max. So that cannot be it...

the weird thing is, the form worked perfectly well, and then it just stopped...

thanks for getting back to me I really appreciate it. Most of all, my fingertips really appreciate it, as there are no nails, nor skin left...
V
#4

[eluser]vevmesteren[/eluser]
Well I kept on checking and I finally found what my problem was. Let me elaborate. My original form holds 28 fields plus 3 file inputs. That can, obviously lead to quite heavy submissions. And therein lays the problem. I was exceeding the post_max_size value of my PHP configuration. How did I realize this? Every time I turned on my file submission, my entire post vanished. Not just an empty $_FILES array but an empty $_POST array as well.

Thanks for your time still

yeah!




Theme © iAndrew 2016 - Forum software by © MyBB