Skip to content

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.

collection name could be specified in url

Xiaodong Huo166cc0d48a38
diff --git a/go/weed/weed_server/filer_server_handlers.go b/go/weed/weed_server/filer_server_handlers.go
index 1695296d4c..e6f1628dab 100644
--- a/go/weed/weed_server/filer_server_handlers.go
+++ b/go/weed/weed_server/filer_server_handlers.go
@@ -130,7 +130,11 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) {
if replication == "" {
replication = fs.defaultReplication
}
- assignResult, ae := operation.Assign(fs.master, 1, replication, fs.collection, query.Get("ttl"))
+ collection := query.Get("collection")
+ if collection == "" {
+ collection = fs.collection
+ }
+ assignResult, ae := operation.Assign(fs.master, 1, replication, collection, query.Get("ttl"))
if ae != nil {
glog.V(0).Infoln("failing to assign a file id", ae.Error())
writeJsonError(w, r, http.StatusInternalServerError, ae)