views:

126

answers:

2

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
+1  A: 

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);

jordanstephens
i forgot to add another important piece of info:i'm upload a 70mb ZIP filecould debugging maybe put 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.
Garrett
+3  A: 

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
Garrett
This is what I was going to suggest.
VirtuosiMedia