jothie

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.

Downloaded and tested - no change.
But i have tested it on a mac - there it works.
But on every W11 PC i tested -> failed.

    5 days later
    8 days later

    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

    tmp.zip
    115B

      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?

      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;
        }

        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

          bauernbengel

          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.

          Write a Reply...