PDA

View Full Version : Form not posting any data



Gardy
10-20-2010, 02:00 PM
Hey all,

I have a form where i need to upload 2 files. If I only select one file then the form works fine, but if I select a file in both boxes then no data is posted. Below is the code that I am using, any help here would be very much appciated.

Thanks,


<form action="" method="post" name="client-balances-selection" enctype="multipart/form-data">
<div id="current-balances">
<h3>Current client balances</h3>
<input type="file" name="[file]current_balances" class="file_upload" />
</div>
<div id="past-balances">
<h3>Past client balances</h3>
<input type="file" name="[file]past_balances" class="file_upload" />
</div>
<input type="submit" name="action" class="button-primary" value="<?php _e('Compare'); ?>" />
<input type="submit" name="action" class="button-delete" value="<?php _e('Delete old files'); ?>" onclick="return (confirm('Are you sure you wish to delete all client balance files?'));" />
</form>

abduraooft
10-20-2010, 02:28 PM
but if I select a file in both boxes then no data is posted
Put the following at the top of your page and check the result on both the cases.

echo '<pre>';
print_r($_FILES);
echo '</pre>';

Gardy
10-20-2010, 02:35 PM
Thanks for the reply.

Same results as before - fine if either one of the inputs is used, but returns an empty array if they are both used.

Thanks.

Gardy
10-20-2010, 04:07 PM
Think I have got it - My php.ini file has 8MB as the maximum file upload size, so I assumed that this meant each file could be up to 8MB in size - turns out it is 8MB total though, so I look to now have this sussed.

Thanks for the input.

abduraooft
10-20-2010, 04:14 PM
Think I have got it - My php.ini file has 8MB as the maximum file upload size, so I assumed that this meant each file could be up to 8MB in size - turns out it is 8MB total though, so I look to now have this sussed. You should have got the clues from the output of the lines that I've given!