Ver código fonte

added content type by extension for local storage

tags/v1.0.0
Remco 9 anos atrás
pai
commit
3f061f4941
1 arquivos alterados com 2 adições e 1 exclusões
  1. +2
    -1
      transfersh-server/storage.go

+ 2
- 1
transfersh-server/storage.go Ver arquivo

@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"github.com/goamz/goamz/s3" "github.com/goamz/goamz/s3"
"io" "io"
"mime"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
@@ -37,7 +38,7 @@ func (s *LocalStorage) Get(token string, filename string) (reader io.ReadCloser,


contentLength = uint64(fi.Size()) contentLength = uint64(fi.Size())


contentType = ""
contentType = mime.TypeByExtension(filepath.Ext(filename))


return return
} }


Carregando…
Cancelar
Salvar