SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
filer: set mime type from volume server
Chris Lu0375ce2c2e77
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.goindex 884933f187..a6dde973f4 100644--- a/weed/operation/upload_content.go+++ b/weed/operation/upload_content.go@@ -27,6 +27,7 @@ type UploadResult struct {Error string `json:"error,omitempty"`ETag string `json:"eTag,omitempty"`CipherKey []byte `json:"cipherKey,omitempty"`+ Mime string `json:"mime,omitempty"`}var (diff --git a/weed/server/filer_server_handlers_write.go b/weed/server/filer_server_handlers_write.goindex b363334475..01f46a53ba 100644--- a/weed/server/filer_server_handlers_write.go+++ b/weed/server/filer_server_handlers_write.go@@ -186,6 +186,7 @@ func (fs *FilerServer) updateFilerStore(ctx context.Context, r *http.Request, wReplication: replication,Collection: collection,TtlSec: int32(util.ParseInt(r.URL.Query().Get("ttl"), 0)),+ Mime: ret.Mime,},Chunks: []*filer_pb.FileChunk{{FileId: fileId,@@ -194,8 +195,10 @@ func (fs *FilerServer) updateFilerStore(ctx context.Context, r *http.Request, wETag: ret.ETag,}},}- if ext := filenamePath.Ext(path); ext != "" {- entry.Attr.Mime = mime.TypeByExtension(ext)+ if entry.Attr.Mime == "" {+ if ext := filenamePath.Ext(path); ext != "" {+ entry.Attr.Mime = mime.TypeByExtension(ext)+ }}// glog.V(4).Infof("saving %s => %+v", path, entry)if dbErr := fs.filer.CreateEntry(ctx, entry, false); dbErr != nil {diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.goindex b6a242641f..101be4c43c 100644--- a/weed/server/volume_server_handlers_write.go+++ b/weed/server/volume_server_handlers_write.go@@ -68,6 +68,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {}ret.Size = uint32(originalSize)ret.ETag = needle.Etag()+ ret.Mime = string(needle.Mime)setEtag(w, ret.ETag)writeJsonQuiet(w, r, httpStatus, ret)}