mbrlabs / fileport

Fileport is a web based file browser
Apache License 2.0
14 stars 2 forks source link

determine filetype by its magic number signature, not filename extension #2

Open brownchow opened 3 years ago

brownchow commented 3 years ago

I noticed that, filetype was determined by filename extension, see utils.go, this workes in most case, but, if we can determine filetype by its magic number signature, it well be better, since filename extension may be changed unexpectly.

there is a package called h2non/filetype, maybe we can use that package in the project