I'm having the same problem. osTicket (v1.8.1.2), debian 7.4, apache 2.2.22, php 5.4.4, using the filesystem attachment plugin.When a user sends an email with attachments, they are properly added to the ticket system and they are on the filesystem, however, when the staff tries to open them from the web interface, they are corrupt.I looked at the files in the filesystem and the database entry and noticed that the file size value in the database is incorrect.For example: small image/gif file from a html signature is showing a file size of 1586 bytes:# ls -la m/mo9twVkFS0x4fMgeF0b7PZv0B7TtqYW0-rw-r--r-- 1 root www-data 1586 Apr 26 11 m/mo9twVkFS0x4fMgeF0b7PZv0B7TtqYW0However, the database entry in the ost_file db table shows a size of 1249 bytes.I compared all other attachments and all sizes in the ost_file table are incorrect.Replacing the value in the ost_file table with the correct one solves the issue and the file can be properly downloaded from the web interface and the file is not corrupt (which makes sense as the end of the file isn't missing).I tried enforcing calculating the filesize when saving it in include/class.file.php by commenting out the condition in line 311, but that did not make any difference. Somewhere/somehow, the save function receives an incomplete data stream.I'm new to osticket and don't know the internal structure yet. Any advice or help finding the cause of this bug would be appreciated. Thanks.