简体   繁体   中英

Large size image's base64 (as FormData param) not sent via AJAX POST request

I am having an issue, when i send a large size image in base64 (around 20 MB) as a FormData param the AJAX POST request does not work. If it is less than 10 MB, the request FormData params work correctly. Why is it behaving like this?

var formData = new FormData();
formData.append(“base64Image”, “<LARGE SIZE BASE64 STRING>”);
$.ajax({
   url : "/api/extensions",// no i18n
   method : "POST",//no i18n
   processData : false,
   contentType : false,
   data : formData
   ...
});

I believe this is a server issue. Not sure what server you're using but in Payara I think they configure the max allowed upload size like this;

max-post-size-bytes , can be configured also in admin console, setting it to -1 will remove size limits and accept any request

max-form-post-size-bytes this cannot be configured in Admin console, only via asadmin command this is only being applied to requests with content type application/x-www-form-urlencoded, therefore it is ignored for most form file uploads"

from here

EDIT : from other questions I've seen on the internet about this exact issue, there have been dodgy server config/php_ini files that haven't been parsed properly, multiple settings files that you might have to configure, but for struts, could you try and implement the example in this walk through? Also, are you sure your config has 100000000 bytes and not 10000000?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM