Page 1 of 1

MAX SIZE of attachement limit at 2G on last Hesk version

Posted: Fri Oct 14, 2022 9:30 am
by nothern
Hi!

I just updated to last Hesk version 4.0.1 (as we are using Office 365 we need it with OAuth...)
Ubuntu 18
PHP 7.0.33

My issue is on uploaded files;
PHP handle the size of 30G /file and max 6 files (in php.ini)

When I upload a file now for example 3G; I see it in TEMP directory at normal size... then the server is taking a long when the user submitting the ticket; it the TEMP file into the attachments folder (very long time)
The size of the file is correct in the attachments folder but when the user downloads it from the ticket; it's MAX 2G !

I did not have this issue before; and our support needs large files...

Can you help me?
Thanks a lot!

Re: MAX SIZE of attachement limit at 2G on last Hesk version

Posted: Fri Oct 14, 2022 9:52 am
by Klemen
What are your values for these settings in your php.ini?

Code: Select all

max_execution_time
max_input_time
upload_max_filesize
post_max_size
Then you can also try this if it helps:

1. download and install Notepad++ (or use another powerful text editor; do NOT use Microsoft Notepad)
2. open file /inc/attachments.inc.php
3. find this code (line 259):

Code: Select all

    if (hesk_copy($hesk_settings['temp_server_path'].$old_name, $hesk_settings['server_path'].$new_name)) {
        hesk_unlink($hesk_settings['temp_server_path'].$old_name);
    }
and change it to

Code: Select all

rename($hesk_settings['temp_server_path'].$old_name, $hesk_settings['server_path'].$new_name);
4. save, upload to the server, and test

Test first with a file < 4GB, then with a file > 4GB

Re: MAX SIZE of attachement limit at 2G on last Hesk version

Posted: Thu Oct 27, 2022 8:45 am
by nothern
Thanks; I tested it
with the modification; when a client upload a file; the server file transfer from the TEMP to the attachments directory is very quick so it's much faster to submit an answer under Hesk (good point). Can I let this version on the production server?

But the size is still limited to 2,09Go when I download it from the link under Hesk GUI
The size of the file (3,13Go) in the attachment directory is good; same as the original file

here the php.ini (version 7.0 used by apache2)

/etc/php/7.0/apache2/php.ini:
max_execution_time = 4000 (so 66minutes; it does not take this time...)
max_input_time = -1
post_max_size = 0
file_uploads = On
upload_tmp_dir = /home/XYZ/TMP/
upload_max_filesize = 30G
max_file_uploads = 10
post_max_size = 300G

/etc/php/7.0/apache2$ php -v
PHP 7.0.33-62+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Sep 18 2022 10:19:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-62+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

Thanks a lot for your help =)

Re: MAX SIZE of attachement limit at 2G on last Hesk version

Posted: Thu Oct 27, 2022 9:33 am
by Klemen
Yes, that is safe for the production server.

Not sure what is happening on your server that downloads stop at 2.09 GB, a limit must be reached. Make sure you use 64-bit operating system and software versions, 32-bit systems are usually limited to 2GB physical memory. The way download_attachments.php file handles downloads hasn't changed for 10+ years so it's not something that would be caused by the new version of Hesk.