mimetype
mimetype copied to clipboard
The msi file is marked to msword
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)
If you don't have any privacy concerns, please upload the .msi file.
Does disabling the limit help?
mimetype.SetLimit(0)
mimetype.Detect(.msi)
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
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.
Thanks, in the above way, the problem is solved。 the result: mime: application/x-ms-installer Extension: .msi