jothie
Yea, you can take screenshots and upload those instead. Or make a GIF and upload that.
Cheers.
So here they are:
jothie The Response tab
Attached the response tab:
So apparently the file is invalid in your case somehow but it wasn't for me. Apparently the given MIME TYPE doesn't match the MIME Type returned from FileObject::mime_type():
FileObject::mime_type()
You're right, i have commented out this lines: // Make sure mime type is valid //if (strcasecmp(FileObject::mime_type($file['tmp_name']), // $file['type']) !== 0) // return false; and it works. It have checked the old source 1.17.1 -> This lines seems to be new in 1.17.2 or 1.17.3.
Many thanks for your help.
Yes, it's a security patch. But it's very strange that I'm able to upload this and you are not. I wonder what the difference is here.. 🤔
Can you please create a PHP file in your osTicket directory, paste the following content, visit the file in the browser, and tell me what the page displays?
<?php var_dump('finfo_open exists: ', function_exists('finfo_open'));
sure ;-): string(19) "finfo_open exists: " bool(true)
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.
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
melgsondouglas
solved by activating the fileinfo in the php manager
Everyone,
Here is the patch:
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
bauernbengel
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?
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
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; }
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.
Also, yes, I tried your file and worked without issue.