When the content-length of a file you are trying to download via curl is quite larger that the max-filesize (CURLOPT_MAXFILESIZE), the process will automatically stop and exit with ‘curl (63) maximum file size exceeded’ error.
As part of our Server Support Services, we have previously helped customers fix curl related issues.
In this context, we shall look into what this error occurs and how to fix it.
More about curl (63) maximum file size exceeded error
curl command helps to process download requests from a http external server source and retrieves data back to the server.
CURLOPT_MAXFILESIZE helps to determine the maximum file size to be downloaded to the server. When a curl request is being processed, the server headers is parsed by curl and it locates the Content-Length. In the case whereby the content-length is larger than the curlopt_maxfilesize, the process will terminate and exit with error message: curl: (63) Maximum file size exceeded.
How to solve curl: (63) Maximum file size exceeded http error
Solving this issue can be approached with different methods;
i. To begin, take a look at the upload limit on the external server where the file to be downloaded is. Then you can adjust the php.ini configuration file considering the following attributes;
ii. In addition, this error can also be eliminated by increasing the curlopt_maxfilesize value.