Why am I getting a 413 error upon file upload even though there are adequate file sizes present on the server?

Asked
Active3 hr before
Viewed126 times

6 Answers

uploaderrorgetting
90%

A 413 HTTP error code occurs when the size of a client’s request exceeds the server’s file size limit. This typically happens when a client attempts to upload a large file to a web server, and the server responds with a 413 error to alert the client.,Web servers place size limits on uploads to prevent users from overwhelming the server and exceeding storage permissions. This limit usually isn’t an issue, and common website files should stay well under it. However, especially large file uploads may occasionally exceed the limit, resulting in a message like this:,If you want to make this change permanent, we recommend trying the above approaches first. With this approach, you’ll need to update functions.php whenever you update or change your current theme.,After trying one or more of the solutions above, you still may encounter a 413 error when uploading large files, even if these files are below your new size limit.

 @ini_set(‘upload_max_size’, ’64 M’);
 @ini_set(‘post_max_size’, ’64 M’);
 @ini_set(‘max_execution_time’, ‘300’);
load more v
88%

As such, to fix the “413 Request Entity Too Large” error, you’ll need the following:,As for why the error occurs, the simple explanation is that the server is set up to deny explicit uploads that are too large. Think of times when you upload a file where there’s a maximum file size limit:,WordPress errors come in all shapes and sizes. In most cases they’re easy to decipher; such is the accessibility of WordPress’ error reporting. Even so, when the “413 Request Entity Too Large” error pops up, it can leave you scratching your head.,When you’re ready, save your file and upload it to the server again. Then, check whether the “413 Request Entity Too Large” error still exists. If it does, head onto the next method.

Once you have a file open, enter the following:

@ini_set('_max_size', '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');
load more v
72%

After you are finished, save the changes and try head back to WordPress admin area to test if you still get 413 error.,Make sure you save the modification and close the window. Go back to WordPress admin area and try upload a new.,Ever tried uploading a file to WordPress only to see the 413 Request Entity Too Large error pop up? Annoying, right? Well don’t worry, we have a solution! In this article, we will teach you how to fix the 413 Request Entity Too Large error in WordPress.,If you want to upload a file larger than allowed by your server, you will face the 413 Request Entity Too Large error in WordPress. In this tutorial we overviewed 3 different methods to fix 413 error.

Double click the functions.php file and add the following code snippet. It will increase It will increase upload_max_size, post_max_size and max_execution_time values.

@ini_set('upload_max_size', '256M');
@ini_set('post_max_size', '256M');
@ini_set('max_execution_time', '300');
load more v
65%

This error is also known as the 413 error and it has to do with the size of the file you are uploading. This article will present the causes behind the Request Entity Too Large error and how you can fix it.,5. The new tab that appears will let you edit the .htaccess file. This is where you need to paste the following lines:,Follow these steps with care:,If you want to raise the limit, you’ll have to take matters into your own hands. Read on to learn more about the 413 error and possible solutions.

8. When the dialog boxopens up, paste this code:

@ini_set('upload_max_size', '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300')
load more v
75%

Your web server will fail to upload the file, and you will see the 413 request entity too large error page. ,That being said, let’s take a look at how to fix the the WordPress 413 request entity too large error. , WPBeginner»Blog»Tutorials»How to Fix the 413 Request Entity Too large Error in WordPress,There are multiple ways to fix the request entity too large error in WordPress. We will cover all these methods, and you can try the one that works best for you.

Simply add the following code to your theme’s functions.php file or a site-specific plugin.

@ini_set('upload_max_size', '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');
load more v
40%

Depending on which web server you use, implement the necessary changes described below to configure your web server's maximum HTTP request size allowance. By doing so, you can set the threshold file size for which a client is allowed to upload and if that limit is passed, they will receive a 413 Request Entity Too Large status.,It is dependent upon the type of web server you are using which will determine which directive you need to configure. Whether you want to restrict users from uploading overly large files to your web server or want to increase the upload size limit, the following section will explain how.,The default value for this directive is 1M (1 megabyte). If you do not wish to have a request size limit you can set the value to 0.,Once the above directives are modified to reflect your desired allowable HTTP request size, simply save the configuration and reload PHP-FPM by running the following command: service php-fpm restart.

For Nginx users, the directive which determines what the allowable HTTP request size can be is client_max_body_size. This directive may already be defined in your nginx.conf file located at /etc/nginx/nginx.conf. However, if it isn't, you can add that directive in either an http, server, or location block and define a value.

server {
   client_max_body_size 100 M;
   ...
}
load more v

Other "upload-error" queries related to "Why am I getting a 413 error upon file upload even though there are adequate file sizes present on the server?"