John Davidson

PHP - sending very long string via POST

0 comments
Message:


I have a textarea and very long string (binary data eg: 01 11 21 ...). When I send this data via POST method I don't get a full data. After submit form I check this variable via strlen and I always get 1047572 size. Can I increase this limit? I tried with ini_set('memory_limit') but it didn't work. Thanks in advance for any help.



My Answer:
You may be running into a limitation set by the `post_max_size` directive in your php.ini file. This directive controls the maximum amount of data that can be sent via a POST request.

You can try increasing the `post_max_size` value in your php.ini file to allow for larger amounts of data to be sent via POST.

Additionally, you may also need to increase the `upload_max_filesize` directive if you are dealing with file uploads.

After making changes to the php.ini file, be sure to restart your web server for the changes to take effect.

If you are unable to modify the php.ini file, you can also try setting these values in your PHP script using `ini_set()` function before processing the POST data:

php
ini_set('post_max_size', '20M');
ini_set('upload_max_filesize', '20M');


Replace '20M' with the desired maximum size in megabytes.

Remember that increasing these limits can have an impact on server performance and memory usage, so be sure to consider the implications before making changes.

Rate this post

5 of 5 based on 5262 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us