fix: seek after mime read
This commit is contained in:
parent
8ccd90825b
commit
d913e0f7b2
|
@ -2007,6 +2007,12 @@ func (s *S5API) downloadFile(jc jape.Context) {
|
|||
return
|
||||
}
|
||||
mimeType = detectedType.String()
|
||||
_, err = file.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
s.logger.Error("error seeking file", zap.Error(err))
|
||||
_ = jc.Error(err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if len(mimeType) == 0 {
|
||||
|
|
Loading…
Reference in New Issue