aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/submit.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2017-01-03 21:23:08 -0800
committerGitHub <noreply@github.com>2017-01-03 21:23:08 -0800
commit297f64e286873b0740c55580a1061129a94d2b0c (patch)
tree0c8fdfd9c54ca4babc9a63e3ef24b019ed7d80e8 /weed/operation/submit.go
parent8fb29e523009901d7bcc5adff8a3da83ea515a18 (diff)
parentd96d0a87cfb9aa26b83702a72a3affe6d72697b3 (diff)
downloadseaweedfs-297f64e286873b0740c55580a1061129a94d2b0c.tar.xz
seaweedfs-297f64e286873b0740c55580a1061129a94d2b0c.zip
Merge pull request #428 from sparklxb/master
fix bug: upload big .gz file more than maxMB
Diffstat (limited to 'weed/operation/submit.go')
-rw-r--r--weed/operation/submit.go11
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)