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
Fix Content-Disposition header; add dl=(0|1) URI param to use inline (default) or attachment
Alexander Kovalenkof101ad6855ae
diff --git a/go/weed/weed_server/volume_server_handlers_read.go b/go/weed/weed_server/volume_server_handlers_read.goindex 0bfe06d42b..5f31997382 100644--- a/go/weed/weed_server/volume_server_handlers_read.go+++ b/go/weed/weed_server/volume_server_handlers_read.go@@ -197,7 +197,13 @@ func writeResponseContent(filename, mimeType string, rs io.ReadSeeker, w http.Rew.Header().Set("Content-Type", mimeType)}if filename != "" {- w.Header().Set("Content-Disposition", `filename="`+fileNameEscaper.Replace(filename)+`"`)+ contentDisposition := "inline"+ if r.FormValue("dl") != "" {+ if dl, _ := strconv.ParseBool(r.FormValue("dl")); dl {+ contentDisposition = "attachment"+ }+ }+ w.Header().Set("Content-Disposition", contentDisposition+`; filename="`+fileNameEscaper.Replace(filename)+`"`)}w.Header().Set("Accept-Ranges", "bytes")if r.Method == "HEAD" {