Reputation: 11725
i'm uploading a 70mb ZIP file. perhaps debugging may be putting things out of sync? when i don't have the file in the file input, i get the post data, but when i do, the post data is empty.
<form method="post" action="load_statements.php?action=load" id="form1" enctype="multipart/form-data">
i have fields (with the name attribute) and a submit button inside the form. however, when i try to access them, i get:
Notice: /fiq_local/load_statements.php line 33 - Undefined index: statementType
Notice: /fiq_local/load_statements.php line 45 - Undefined index: year
Notice: /fiq_local/load_statements.php line 47 - Undefined index: idVar
Notice: /fiq_local/load_statements.php line 49 - Undefined index: attachment
they all follow the same syntax. here is one:
$statementType = $_POST['statementType'];
it seems that the upload is taking a long time, so i'm guessing it's the problem. how can i deal with a large file upload and still get the post data?
i set the following in my php.ini:
; Maximum allowed size for uploaded files.
upload_max_filesize = 1000M
Upvotes: 1
Views: 2101
Reputation: 11725
it all had to do with the php configurations!
you need:
; Maximum allowed size for uploaded files.
upload_max_filesize = 1000M
and
; Maximum size of POST data that PHP will accept.
post_max_size = 1000M
Upvotes: 4
Reputation: 4510
Are you sure those indexes exist in $_POST
? The only way I've ever solved this problem is by using isset()
before using the var. However, it appears you are doing that.
Therefore, I am going to leave my recommendation at turn off E_NOTICE
error reporting in your production code:
error_reporting (E_ALL ^ E_NOTICE);
Upvotes: 1