NOTE: This article applies to the specific versions of software: X-Cart 5.3.3.2 and later.
This guide offers some tips on confining your X-Cart server to allow customers to download large file attachments (100 Mb and more). Without configuring the following settings, any large download will hang up.
Adjust the XCART_OTHER_USE_SENDFILE variable in the .env.local
file on the server:
XCART_OTHER_USE_SENDFILE = 1
Then execute the following console command to clear the store service data cache:
./bin/console cache:clear
After that, you will also need to perform server-specific configurations, as provided below.
Apache-Specific Configuration
Apache server requires mod_xsendfile to enable the XSendFile option and the corresponding headers. So you will need to make sure it is available.
Also, you will need to edit the main .htaccess file in the root of the X-Cart folder and add the following config option:
XSendFile On
On X-Cart 5.3.3.2 or later installations, this option is included by default.
Nginx-Specific Configuration
You'll need to add the following "location" directive into the "server" section of the server configuration file and replace the <STORE ROOT> part with the path to the X-Cart folder:
location /storage_download/ { internal; alias <STORE ROOT>/public/files/; }
If your site is placed in a subdirectory of your webroot, you should specify the path to this subdirectory in the <STORE ROOT>
part.
Related pages: