Hi there, long time user and fan of osTicket, I hope I can explain my issue correctly so you can point me in the right direction.

Configuration
Server: Debian 10.10 buster
osTicket: 1.15.2
Apache: 2.4.38
PHP: 7.3.29-1deb10u1
MariaDB: 15.1 Distrib 10.3.29

I made the upgrade from 1.14.2 to 1.14.6 and then to 1.15.2 and everything works ok, so far, except for attaching files in the reply area or pasting images in the same place.

Tickets that are sent to the plattform containing attachments have no problem and they are created and you can download the attachment, same with embedded images.

Upon inspection of my problem I see two errors in the web console (tried with different browsers too):

  • 500 (Internal Server Error) when I tried to attach a file via drag and drop or File Explorer and popup with "File Upload Error" undefined 500
  • 403 (Forbidden) when tried to paste an image in the reply area

The apache error log shows the following, I understand this is PHP writing on here cause I haven't defined another location for this error log to be written. (here is my php info anyway https://cloud.feligato.com/s/Gqxi624egx4kqKd)

[Tue Jul 06 17:47:14.836577 2021] [php7:warn] [pid 5236] [client 10.8.64.107:1032] PHP Warning: fopen(): Filename cannot be empty in /var/www/html/include/ajax.draft.php on line 64, referer: http://soporte.ssmoc.gob.cl/scp/tickets.php?id=48255
[Tue Jul 06 17:47:14.836647 2021] [php7:warn] [pid 5236] [client 10.8.64.107:1032] PHP Warning: fread() expects parameter 1 to be resource, bool given in /var/www/html/include/ajax.draft.php on line 65, referer: http://soporte.ssmoc.gob.cl/scp/tickets.php?id=48255
[Tue Jul 06 17:47:14.836663 2021] [php7:warn] [pid 5236] [client 10.8.64.107:1032] PHP Warning: fclose() expects parameter 1 to be resource, bool given in /var/www/html/include/ajax.draft.php on line 76, referer: http://soporte.ssmoc.gob.cl/scp/tickets.php?id=48255

I have the "Attachments on the filesystem" plugin Enabled, I tried with the database option with the same results. Also I made a "clean install" with this guide https://tmib.net/upgrading-osticket-from-1-14-x-to-1-15-x/, and the error continues.

I also checked the MariaDB-Mysql error log, and just found some issues with the innodb_index_stats and a lenght mismatch that I fixed with the mysql_upgrade but the problem persists.

All the troubleshooting above was made following other threads with similar issues, but not quite the same, so I think my problem could be around permissions. On that I can also say that I have not SElinux or mod_security configured, and all the files and directories have a "www-data" read, write on the osTicket folder.

Sry for my English ,not main language here, also, if you need more info that I can provide please let me know.
Thanks in advance for your assistance

First thing I would check is: Admin panel -> Settings -> Tickets
Scroll all the way down to the bottom e and click on the Config button to the right of Ticket Attachment Settings.
Ensure that the file extension is listed in Additional File Type Filters
Click Save, and then retest adding the file to a ticket.

7 days later

Thanks for your answer @ntozier , I forgot to add that to the list of actions that I did or checked before posting this. Anyway, I tried adding the pdf extension with the same results. Still trying to figure it out from the server, I think the app is ok. Thanks again for your time.

Try adding the file type .jpg to Additional File Type Filters.

5 days later

Hi, I tried your suggestion but same results.
I would try to migrate to another server this week, restoring a db backup maybe to a new installation or other things that come to my mind so I can isolate my problem.

Thanks again

7 months later

Hi
the same error here.
My configuration is:

Chrome show this error when staff try to upload (for customer upload works):

Any idea?
Thank you
Daniele

2 years later

I had a similar issue but managed to fix it. In my case it was a MIME type mismatch for .zip files. My computer used application/x-zip-compressed while osTicket expected application/zip. It appears there are many different MIME types in use for .zip files. And it appears osTicket compares MIME type instead of file extensions. Curious design choice; especially considering the UI allowes additional file extension to be added (to no apparent affect.)

The MIME type application/x-zip-compressed might be a result of using 7Zip but I'm not sure.

To fix it, open regedit, locate the file type, modify the Content Type to use whatever the webserver expects.

    wronex

    In 1.17.x/1.18.x we only verify the mime-type if you explicitly enable it (Admin Panel > Settings > Tickets > Ticket Attachment Settings > Config > Strict Mime Type Check).

    We used to verify the mime-types all the time to prevent someone from doing a mime-type bypass and other similar attacks. If you enable the setting it will check the given mime-type from the upload request against the file's true mime-type which is loaded from the server OS. You can see the method we use to check here:

    So the statement of "while osTicket expected application/zip" is not entirely true. This is determined by your server OS as we pull this info from the finfo_open() and finfo_file() commands.

    Cheers.

    Write a Reply...