Skip to content
Snippets Groups Projects
  • Jared Hancock's avatar
    Fix truncating of attachments on upload · c7ba35a9
    Jared Hancock authored
    MySQL is kind enough to quietly truncate the filedata field when attempting
    to CONCAT data beyond the size of max_allowed_packet. The simplest fix is to
    automatically adjust the max_allowed_packet to the size of the file being
    uploaded plus some extra. See MySQL bugs #22853, #34782, and #63919 for more
    discussion on the issue.
    
    The max_allowed_packet variable default to 1M, but is expandable to 1G.
    Therefore, the fixed limit of attachments for osTicket will be 1G, since it
    would be impossible for MySQL to append data after that mark. *Sigh*
    c7ba35a9