From 2d303a68a6d4c82f96a8c057cd45e85e0475d86f Mon Sep 17 00:00:00 2001 From: Remco Date: Mon, 10 Nov 2014 17:18:24 +0100 Subject: [PATCH] added content type by extension for local storage --- transfersh-server/storage.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transfersh-server/storage.go b/transfersh-server/storage.go index f6631c6..2a1a154 100644 --- a/transfersh-server/storage.go +++ b/transfersh-server/storage.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/goamz/goamz/s3" "io" + "mime" "os" "path/filepath" "strconv" @@ -37,7 +38,7 @@ func (s *LocalStorage) Get(token string, filename string) (reader io.ReadCloser, contentLength = uint64(fi.Size()) - contentType = "" + contentType = mime.TypeByExtension(filepath.Ext(filename)) return }