aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_copy.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index a61118bbf..8d6b84ff2 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -174,7 +174,7 @@ func uploadFileAsOne(filerUrl string, urlFolder string, f *os.File, fi os.FileIn
fmt.Printf("uploaded %s to %s\n", f.Name(), targetUrl)
if err = filer_operation.RegisterFile(filerUrl, filepath.Join(urlFolder, f.Name()), assignResult.Fid, fi.Size(),
- os.Getuid(), os.Getgid(), copy.secret); err != nil {
+ mimeType, os.Getuid(), os.Getgid(), copy.secret); err != nil {
fmt.Printf("Failed to register file %s on %s: %v\n", f.Name(), filerUrl, err)
return false
}
@@ -185,6 +185,8 @@ func uploadFileAsOne(filerUrl string, urlFolder string, f *os.File, fi os.FileIn
func uploadFileInChunks(filerUrl string, urlFolder string, f *os.File, fi os.FileInfo, chunkCount int, chunkSize int64) bool {
+ mimeType := detectMimeType(f)
+
var chunks []*filer_pb.FileChunk
for i := int64(0); i < int64(chunkCount); i++ {
@@ -235,6 +237,7 @@ func uploadFileInChunks(filerUrl string, urlFolder string, f *os.File, fi os.Fil
Uid: uint32(os.Getuid()),
FileSize: uint64(fi.Size()),
FileMode: uint32(fi.Mode()),
+ Mime: mimeType,
},
Chunks: chunks,
},