sure ;-):
string(19) "finfo_open exists: " bool(true)
Error Uploading / attaching files to ticket
- Edited
That would be the only difference but you have that method as well so I'm not sure why you can't but I can without making any changes...so odd. Can you download the example you uploaded to the Forum and retest with the downloaded ZIP? I wonder if uploading it here fixed the MIME Type.
Cheers.
- Edited
Downloaded and tested - no change.
But i have tested it on a mac - there it works.
But on every W11 PC i tested -> failed.
We're having the same issue. Had to comment out this as a temp fix:
https://github.com/osTicket/osTicket/blob/develop/include/class.forms.php#L3975-L3977
jothie , we had the same issue with saving emails on Mac vs windows. The difference was that Mac uses .eml files which work ok, Windows uses .msg, which does not work.
I'm not sure if you're having the same problem.
we have the same issues after updating to v1.17.3, we used version 1.17.2
- Best Answerset by KevinTheJedi
The problem ist that $file['type'] and FileObject::mime_type($file['tmp_name']) do not return the same result.
in case of a zip-file:
string(28) "application/x-zip-compressed"
string(24) "application/octet-stream"
samplefile attached
Yes, I have seen this with someone else, however I’m unable to replicate this with ZIP files in my instance. What version of PHP are you using? What browser are you using? What OS are you using when uploading the file?
Cheers.
Ugly Fix:
class.forms.php replace the function
static function isValidFile($file) { // Make sure mime type is valid #var_dump($file['type'], FileObject::mime_type($file['tmp_name']));die; #if (!empty($file['type']) && strcasecmp(FileObject::mime_type($file['tmp_name']), # $file['type']) !== 0) # return false; // Check invalid image hacks if ($file['tmp_name'] && stripos($file['type'], 'image/') === 0 && !exif_imagetype($file['tmp_name'])) return false; return true; }
- Edited
KevinTheJedi do you used my ZIP-file?
osTicket-Version osTicket FREE v1.17.3 (ca95150) Patch-1 — Deutsche Version — Aktuell
Server-Software Apache/2.4.51 (Unix)
MySQL-Version 10.3.32
PHP-Version 8.0.23
Browser: Opera,Vivaldi,Chrome
OS Win10/Win11
If I were you I’d install a vanilla osTicket and retest there. We do not support the German version. They make customizations to the code so it’s not official osTicket.
Cheers.