Answer the question
In order to leave comments, you need to log in
When sending a bulk POST, we get a 404 error, why?
Hello! I have a vizivig editor on my site.
When I insert a picture from a computer there, the editor creates an img tag, and as src prescribes the content of the picture encoded in base64. That is, even if you insert a 2x2 pixel image, the number of characters that the vizivig-editor generates is more than a hundred.
The problem is that if you try to insert a large image that weighs 1.5 megabytes and submit the form, it redirects to a 404 error . Because in this case, the number of characters will be almost 2 million. And I'm trying to transfer these two million to POST.
Error log is empty. After submitting the form, I try to display all the data simply throughprint_r($_POST)
, and even in this case, a redirect to 404 occurs with a large picture, but everything is fine with a small one.
Are there any limits on the length of a string in a POST? Or is there some client-side solution so that before submitting the form, the images are compressed somehow or redrawn to a lower resolution, for example, using JS?
UPD: Added source code.
<form method="POST" action="/cabinet/new/" id="new_case" autocomplete="off" enctype="multipart/form-data">
<textarea id="summernote" name="new_case_body"></textarea>
<input type="submit" name="new_case" id="fs" value="Сохранить">
</form>
if (isset($_POST['new_case'])) {
print_r($_POST);exit;
}
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
RewriteRule \.(php|html|swf|fla|xml|ico|jpg|gif|png|txt|js|css|eot|ttf|woff|map)$ - [L]
RewriteRule ^(.*)$ index.php?r=$1 [L,QSA]
memory_limit = 128M
post_max_size = 32M
upload_max_filesize = 2M
Answer the question
In order to leave comments, you need to log in
post_max_size
php.net/manual/ru/ini.core.php#ini.post-max-size
There is also max_upload_filesize
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question