diff options
| author | lixianbin <lixianbin@xiaomi.com> | 2017-01-04 11:23:40 +0800 |
|---|---|---|
| committer | lixianbin <lixianbin@xiaomi.com> | 2017-01-04 11:23:40 +0800 |
| commit | d96d0a87cfb9aa26b83702a72a3affe6d72697b3 (patch) | |
| tree | eb5f984e15defc01f5c81072e27a1a1adabf29b2 /weed/operation/submit.go | |
| parent | f7ff98c747d2d3a4358fc0de8f0de78706ce9dc7 (diff) | |
| download | seaweedfs-d96d0a87cfb9aa26b83702a72a3affe6d72697b3.tar.xz seaweedfs-d96d0a87cfb9aa26b83702a72a3affe6d72697b3.zip | |
fix bug: upload big .gz file more than maxMB
Diffstat (limited to 'weed/operation/submit.go')
| -rw-r--r-- | weed/operation/submit.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/weed/operation/submit.go b/weed/operation/submit.go index 54b6e164e..1de6b544a 100644 --- a/weed/operation/submit.go +++ b/weed/operation/submit.go @@ -92,18 +92,15 @@ func newFilePart(fullPathFilename string) (ret FilePart, err error) { } ret.Reader = fh - if fi, fiErr := fh.Stat(); fiErr != nil { + fi, fiErr := fh.Stat() + if fiErr != nil { glog.V(0).Info("Failed to stat file:", fullPathFilename) return ret, fiErr - } else { - ret.ModTime = fi.ModTime().UTC().Unix() - ret.FileSize = fi.Size() } + ret.ModTime = fi.ModTime().UTC().Unix() + ret.FileSize = fi.Size() ext := strings.ToLower(path.Ext(fullPathFilename)) ret.IsGzipped = ext == ".gz" - if ret.IsGzipped { - ret.FileName = fullPathFilename[0 : len(fullPathFilename)-3] - } ret.FileName = fullPathFilename if ext != "" { ret.MimeType = mime.TypeByExtension(ext) |
