Coder Social home page Coder Social logo

Comments (3)

vangent avatar vangent commented on May 16, 2024

I explored this a bit:

  • It looks like AWS allows you to set ContentLength in PutObjectInput as you say. I haven't tested it. Does it require an exact match, or is a maximum length?
  • GCS allows a range, via storage.GenerateSignedPostPolicyV4: https://stackoverflow.com/q/63230403.
  • I don't see any way to do this for Azure.
  • I think fileblob could support an exact match.

This will be hard for you to contribute, because in order to test it we'd want to add a driver test, which will update all of our golden files and requires access to our test projects, but if we can find reasonable semantics that are supported across the providers I can add it.

from go-cloud.

mrth1995 avatar mrth1995 commented on May 16, 2024

Hi vangent thanks for the response!

As per my exploration on AWS, its exact content length.
So I guess only Azure that doesn't support this? Are you okay if we add this feature to go-cloud?
It'll be helpful for given usecase I think.

Thanks!

from go-cloud.

vangent avatar vangent commented on May 16, 2024

I looked into this some more. GCS doesn't support this either, at least not in the same way; it has https://pkg.go.dev/cloud.google.com/go/storage#GenerateSignedPostPolicyV4, but that's for POST, not PUT.

Given the lack of consistency across providers, I don't think it makes sense to add to Go CDK.

You can use As (https://gocloud.dev/concepts/as/) and SignedURLOptions.BeforeSign (https://pkg.go.dev/gocloud.dev/blob#SignedURLOptions) to set the PutObjectInput.ContentLength for S3. Here's an example using As for writes that should be similar: https://pkg.go.dev/gocloud.dev/blob#example-WriterOptions.

from go-cloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.