uploading files works when my php.ini settings are set to default values:

upload_max_filesize = 20M
post_max_size = 20M
memory_limit	128M

However, we wanted bigger attachments, so we increased to:

upload_max_filesize = 100M
post_max_size = 100M
memory_limit	128M

Now, we can change the allowed size in Settings>Tickets>Ticket attachment settings and Settings>System>Agent Max File Size.

However, whatever size we choose here, when we attempt to attach a file to a ticket, we get a javascript popup with the text:

File Upload Error: 
nameofthefile.ext
File is too largeundefined

There are no messages in the console and no failed requests.

Further details:

  • we run with the Apache web server, php 7.2
  • osTicket is at the latest version
  • We use the file system storage for the attachments
  • After changes in php.ini, the Apache service is restarted
  • There are no errors in the apache error log
  • It seems like no request is made before this error is shown

Also, when reverting the changes in the php.ini file, and lowering the limits in the settings accordingly, we now keep getting this error.

Adding because someone seemed to have gotten this due to a DB table corruption: using mysqlcheck, all tables seem fine.

    michaelcochez
    I am trying to track down were the issue lies. in the javascript console, I can see that the variable
    opts.maxfilesize = 0.25, which then does not allow much of any file to be uploaded. I have no idea where this variable is set from.

    Changing the variable during runtime before it is checked seems to get the systm past this check, but then I get a 413 Payload Too Large from the server for the POST request.

    I'm not entirely sure, but it looks like osTicket uses JS dropzone.
    Try adjust the value maxfilesize in \js\filedrop.field.js.

    Thank you for the suggestion. I changed maxfilesize in 'default_opts' from 1 (MB) to 100 (MB). This did not make a difference, though. Also, during execution, the value becomes 0.25, so the value is set somewhere.

    Getting a bit closer: I had made a mistake in the custom form configuration (file size was small) setting this to 100M, solves the problem on the javascript size.
    We now get 413 Payload Too Large only.

      6 months later

      In our case, the chosen maximum file size value was never saved to the config table. This seems to be a bug. In this table, you have a row with the key "max_file_size" and a default value of 262144, which corresponds to the default option "Small".

      You can fix this by updating the setting manually. Here's an example for a file size of 8 megabytes. The value has to be calculated with this formula: Desired MB x 1024 x 1024, in this case 8 x 1024 x 1024 = 8388608.

      UPDATE `YOURTABLEPREFIX_config` SET `value` = 8388608 WHERE `namespace` = 'core' AND `key` = 'max_file_size';

        michaelcochez I'm mighty interested 😃 ! Could you describe your "mistake" in the customer form configuration? From my experience: The value of 0.25 is not a frontend value. It comes from the default value in the config table (namespace "core" and key "max_file_size", value 262144, which is 0.25 x 1024 x 1024). It seems that it never gets updated, although you can successfully change the option in the Admin UI. It seems osTicket writes to one place and reads from another.

        a year later
        a year later
        Write a Reply...