What is the file size?
As you said, you can see the file created in your var folder, but the user cannot load it, perhaps this is due to the settings of PHP or the web server.
Regarding php configuration, try updating php.ini with
Upload_max_filesize = 1500 M Max_input_time = 1000 Memory_limit = 640M Max_execution_time = 1800 Post_max_size = 2000 M
Save php.ini and reboot the server.
source: this answer
If it is not a server, you can also add this line to your index.php file (or your main script file):
ini_set('upload_max_filesize', '1500M'); ini_set('memory_limit', '640M');
You can also add or modify the .htaccess file in the download directory ( /var/download ) as follows:
<Files *.*> ForceType applicaton/octet-stream </Files>
source share