aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_copy.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/filer_copy.go')
-rw-r--r--weed/command/filer_copy.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index b519afe86..0f4f96f1b 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -15,7 +15,6 @@ import (
"github.com/chrislusf/seaweedfs/weed/util"
"io"
"net/http"
- "path"
"strconv"
"time"
)
@@ -165,7 +164,6 @@ func uploadFileAsOne(filerAddress, filerGrpcAddress string, urlFolder string, f
// upload the file content
fileName := filepath.Base(f.Name())
mimeType := detectMimeType(f)
- isGzipped := isGzipped(fileName)
var chunks []*filer_pb.FileChunk
@@ -184,7 +182,7 @@ func uploadFileAsOne(filerAddress, filerGrpcAddress string, urlFolder string, f
targetUrl := "http://" + assignResult.Url + "/" + assignResult.Fid
- uploadResult, err := operation.Upload(targetUrl, fileName, f, isGzipped, mimeType, nil, "")
+ uploadResult, err := operation.Upload(targetUrl, fileName, f, false, mimeType, nil, "")
if err != nil {
fmt.Printf("upload data %v to %s: %v\n", fileName, targetUrl, err)
return false
@@ -318,10 +316,6 @@ func uploadFileInChunks(filerAddress, filerGrpcAddress string, urlFolder string,
return true
}
-func isGzipped(filename string) bool {
- return strings.ToLower(path.Ext(filename)) == ".gz"
-}
-
func detectMimeType(f *os.File) string {
head := make([]byte, 512)
f.Seek(0, 0)