mimetype icon indicating copy to clipboard operation
mimetype copied to clipboard

The msi file is marked to msword

Open AFunnyAnt opened this issue 3 years ago • 4 comments

Expected MIME type application/x-ms-installer

Returned MIME type application/msword

Expected Extension .msi

Returned Extension .doc

use version: github.com/gabriel-vasile/mimetype v1.4.0

has tried to do this: mimetype.SetLimit(1024 * 1024)

AFunnyAnt avatar Dec 29 '21 10:12 AFunnyAnt

If you don't have any privacy concerns, please upload the .msi file.

Does disabling the limit help?

 mimetype.SetLimit(0)
 mimetype.Detect(.msi)

gabriel-vasile avatar Jan 10 '22 21:01 gabriel-vasile

mimetype.SetLimit(0) mimeType, xerr := mimetype.DetectFile("./TortoiseGit-32bit.msi") if xerr != nil { fmt.Println("open failed", xerr) } fmt.Println("type:", mimeType.String()) fmt.Println("Extension:", mimeType.Extension())

type: application/msword Extension: .doc

the msi link is: https://download.tortoisegit.org/tgit/2.12.0.0/TortoiseGit-2.12.0.0-32bit.msi

AFunnyAnt avatar Jan 24 '22 02:01 AFunnyAnt

Hi, #240 should fix this.

You can test it with:

go get github.com/gabriel-vasile/mimetype@b497e3d7a11a41902e4e2f29d931521714befc26
mimetype.SetLimit(1024 * 1024)
mimetype.DetectFile("tortoise.msi")

Let me know if there's any problems still.

gabriel-vasile avatar Jan 29 '22 16:01 gabriel-vasile

Thanks, in the above way, the problem is solved。 the result: mime: application/x-ms-installer Extension: .msi

AFunnyAnt avatar Mar 17 '22 02:03 AFunnyAnt