Sucuri Docs > Website Firewall > Troubleshooting > “Failed – Network Error” when Downloading Files

“Failed – Network Error” when Downloading Files

The “Failed – Network Error” error occurs when the file does not download as expected by the browser  because the file size is different from the one previously specified or something happened to the connection during the download.

If this happens often, but only when your website is behind the Sucuri Firewall, the issue could be related to compression algorithms.

zlib.output_compression


The most common cause is “zlib.output_compression”, thus we recommend disabling it or ask your hosting provider or web developer to disable zlib.output_compression in your PHP configuration.

Usually this can be acomplished by adding the following rule to your .htaccess file:

php_flag zlib.output_compression off

Or adding this line to your php.ini file:

zlib.output_compression = Off

You can check if zlib.output_compressionwas sucessfully disabled by checking the PHP information page. For that, create a file named phpinfo.php on the website root directory with the content:

<?php phpinfo(); ?>

Access the phpinfo.php file with your browser and check the following line:

zlib phpinfo

Gzip Compression


The second possible cause would be “Gzip compression”, which is usually activated on Apache by using mod_deflate or gzip directives on NGINX.

We would recommend asking your hosting provider or system administrator to disable “Gzip compression” for you as it requires a higher level of access. If they can’t do this for you and you are using an Apache/LiteSpeed Web Server, you can disable “Gzip compression” on a specific directory with an .htaccess rule:

SetEnvIf Request_URI ^/download/URL no-gzip=1

To check if that worked, use a “Gzip compression” test such as:

Bypassing the WAF


The last option, if none of the previous solutions helped and only the website’s administrators experience this issue, is to bypass the WAF to proceed with the file download.

If the issue continues to occur after the above changes, please open a Support Request so we can investigate.

Was this article helpful?