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.13k stars 177 forks source link

How do I get the http streaming file type #131

Closed dev4mobile closed 1 month 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 9 months ago

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