h2non / filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature
https://pkg.go.dev/github.com/h2non/filetype?tab=doc
MIT License
2.1k stars 175 forks source link

How do I get the http streaming file type #131

Open dev4mobile opened 1 year ago

dev4mobile commented 1 year ago

I would like to retrieve an HTTP response file in a streaming manner. What is the best approach for detecting the file type during the streaming process?

bokunodev commented 8 months ago

you can use bufio reader and call peek method on it.