Posts

Showing posts with the label Wcf

413 Request Entity Too Large

Answer : Add ‘client_max_body_size xxM’ inside the http section in /etc/nginx/nginx.conf, where xx is the size (in megabytes) that you want to allow. http { client_max_body_size 20M; } I had the same issue but in docker. when I faced this issue, added client_max_body_size 120M; to my Nginx server configuration, nginx default configuration file path is /etc/nginx/conf.d/default.conf server { client_max_body_size 120M; ... it resizes max body size to 120 megabytes. pay attention to where you put client_max_body_size , because it effects on its scope. for example if you put client_max_body_size in a location scope, only the location scope will be effected with. after that, I did add these three lines to my PHP docker file RUN echo "max_file_uploads=100" >> /usr/local/etc/php/conf.d/docker-php-ext-max_file_uploads.ini RUN echo "post_max_size=120M" >> /usr/local/etc/php/conf.d/docker-php-ext-post_max_size.ini RUN echo ...

(413) Request Entity Too Large | UploadReadAheadSize

Answer : That is not problem of IIS but the problem of WCF. WCF by default limits messages to 65KB to avoid denial of service attack with large messages. Also if you don't use MTOM it sends byte[] to base64 encoded string (33% increase in size) => 48KB * 1,33 = 64KB To solve this issue you must reconfigure your service to accept larger messages. This issue previously fired 400 Bad Request error but in newer version WCF started to use 413 which is correct status code for this type of error. You need to set maxReceivedMessageSize in your binding. You can also need to set readerQuotas . <system.serviceModel> <bindings> <basicHttpBinding> <binding maxReceivedMessageSize="10485760"> <readerQuotas ... /> </binding> </basicHttpBinding> </bindings> </system.serviceModel> I was having the same issue with IIS 7.5 with a WCF REST Service. Trying to upload via POST any file above 65k...