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
close responses
chrislu870a30665b69
diff --git a/unmaintained/s3/presigned_put/presigned_put.go b/unmaintained/s3/presigned_put/presigned_put.goindex e8368d1248..ba135ff25c 100644--- a/unmaintained/s3/presigned_put/presigned_put.go+++ b/unmaintained/s3/presigned_put/presigned_put.go@@ -1,15 +1,16 @@package mainimport (+ "crypto/md5"+ "encoding/base64"+ "fmt""github.com/aws/aws-sdk-go/aws""github.com/aws/aws-sdk-go/aws/session""github.com/aws/aws-sdk-go/service/s3"- "encoding/base64"- "fmt"- "crypto/md5"+ "github.com/seaweedfs/seaweedfs/weed/util"+ "net/http""strings""time"- "net/http")// Downloads an item from an S3 Bucket in the region configured in the shared config@@ -63,6 +64,7 @@ func main() {fmt.Printf("error put request: %v\n", err)return}+ defer util.CloseResponse(resp)fmt.Printf("response: %+v\n", resp)}@@ -70,4 +72,4 @@ var stringContent = `Generate a Pre-Signed URL for an Amazon S3 PUT Operation wiYou can generate a pre-signed URL for a PUT operation that checks whether users upload the correct content. When the SDK pre-signs a request, it computes the checksum of the request body and generates an MD5 checksum that is included in the pre-signed URL. Users must upload the same content that produces the same MD5 checksum generated by the SDK; otherwise, the operation fails. This is not the Content-MD5, but the signature. To enforce Content-MD5, simply add the header to the request.The following example adds a Body field to generate a pre-signed PUT operation that requires a specific payload to be uploaded by users.-`\ No newline at end of file+`