Frank
Frank

Reputation:

How to process large amount of POST data from a textarea?

I am developing a tool where lots of data (>1MB of data) with lots of lines can be copied and pasted into a textarea. When I submit the form it just shows a blank screen. Nothing happens. Is there a way to process large data submitted by a form with PHP like in chunks and pieces? What are the best practices do handle large amount of data in a web form?

Thanks for you help!!

Upvotes: 2

Views: 2926

Answers (2)

Marc Towler
Marc Towler

Reputation: 705

First off you need to raise the default amount that PHP can handle from 8MB to whatever you think you will need, secondly how to handle that amount of data directly depends on what you actually want to do with it, you would obviously need to clean up malicious code.

Upvotes: 0

alexn
alexn

Reputation: 58962

Check the post_max_size in php.ini. I've never had any issues with uploading post data to a php script.

Are you running any functions on the data? Like stripslashes, htmlentities?

Try adding

enctype="multipart/form-data"

To your form.

And which PHP version do you have? Please refer to the following bug report on PHP.net: http://bugs.php.net/bug.php?id=22427

Upvotes: 1

Related Questions