I am using presigned URLs to upload files (urls are generated via Go code), is there a way to enforce a certain content type and make the uploaded file public for reads prior or after upload?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
You can, for both and they would need to add those parameters to the code, for example here is the Go SDK for uploading; let me see if I can find an example where params has been added too.
Refer to below link:
eg like this curl(but same thing in the Go code in needed), it has a header for content-type:
curl -X PUT
-H “Content-Type: text”
-d “The contents of the file.”
“https://example-space-name.nyc3.digitaloceanspaces.com/new-file.ext?AWSAccessKeyId=EXAMPLE7UQOTHDTF3GK4&Content-Type=text&Expires=1580419378&Signature=YIXPlynk4BALXE6fH7vqbnwjSEw%3D”
Few more links, which will likely be helpful too:
https://docs.ceph.com/en/latest/radosgw/s3/ https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/go/example_code/s3/s3_put_bucket_object_acl.go
Hope this helps!
Cheers, Sri Charan
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.