https://discord.cloudflare.com logo
Join Discord
Powered by
# r2
  • o

    oldmanmeta

    04/12/2023, 7:44 AM
    I was going to post it manually with a fetch, as I just set up a server to gather pre-signed URLS etc, but not sure which direction is best
  • k

    kian

    04/12/2023, 7:44 AM
    PutObject works up to 5 GB but you're at the whim of any network blip ruining that upload
  • k

    kian

    04/12/2023, 7:45 AM
    Multipart is CreateMultipartUpload -> lots of UploadPart -> CompleteMultipartUpload with part numbers & ETags from earlier
  • k

    kian

    04/12/2023, 7:45 AM
    It's a relatively simple flow, but you are responsible for tracking everything up until it's finished
  • k

    kian

    04/12/2023, 7:45 AM
    whereas there's libraries that'll handle it all for you
  • o

    oldmanmeta

    04/12/2023, 7:45 AM
    Hey thanks for that
  • o

    oldmanmeta

    04/12/2023, 7:46 AM
    I was looking into Multer and BusBoy - those look workable, but i've never used them before
  • k

    kian

    04/12/2023, 7:46 AM
    If you did want to implement it yourself, has some good pointers - but I'd definitely recommend a library that likely already comes with progress, retries, etc
  • o

    oldmanmeta

    04/12/2023, 7:47 AM
    I guess I'm concerned in having to build out effectively a relay server to work with CF if it's intended that I send everything there first.
  • o

    oldmanmeta

    04/12/2023, 7:47 AM
    Thanks for that - will take a look
  • k

    kian

    04/12/2023, 7:47 AM
    What exactly is it that you're trying to send to R2, where does that file come from, etc
  • k

    kian

    04/12/2023, 7:48 AM
    i.e user uploads then yeah, presigned URLs offload that work to the user rather than your server
  • k

    kian

    04/12/2023, 7:48 AM
    If it's a file on-disk, just use
    rclone
  • p

    PaCmEn

    04/12/2023, 7:48 AM
    someone know way to set bucket permission by api? I can't find info about it
  • o

    oldmanmeta

    04/12/2023, 7:49 AM
    In this case, they are a user selecting a local file and uploading to R2. The files range in size from just a few 100Mb up to a few Gb
  • k

    kian

    04/12/2023, 7:49 AM
    There's no public API for doing it so you can look at the API calls that the dashboard does but there's no forward notice of breaking changes if it isn't a documented API
  • k

    kian

    04/12/2023, 7:51 AM
    PutObject will work up to 5GB, but it's not very resilient.
  • k

    kian

    04/12/2023, 7:51 AM
    The issue with multipart (and presigned URLs) is that the user has to request each operation as a new URL from you
  • k

    kian

    04/12/2023, 7:51 AM
    So it'll need one to start it, and one for each part, and one to complete it
  • k

    kian

    04/12/2023, 7:51 AM
    https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html
  • k

    kian

    04/12/2023, 7:51 AM
    Oops, this is V2
  • k

    kian

    04/12/2023, 7:52 AM
    There's
    Upload
    in
    @aws-sdk/lib-storage
  • k

    kian

    04/12/2023, 7:53 AM
    If you can hack that together to use presigned URLs is another question
  • k

    kian

    04/12/2023, 7:53 AM
    😦
  • k

    kian

    04/12/2023, 7:53 AM
    There's probably a third party library that'll do it
  • p

    PaCmEn

    04/12/2023, 8:03 AM
    I want to enable access to only one bucket by the API, there is any option to do so?
  • p

    PaCmEn

    04/12/2023, 8:04 AM
    The only API token I can find is for all buckets, and I can't fine grind the permission to only one bucket.
  • p

    PaCmEn

    04/12/2023, 8:09 AM
    Basically i want that each of my "customers" will have READ/WRITE access to their bucket.
  • k

    kian

    04/12/2023, 8:09 AM
    Not currently, no
  • p

    PaCmEn

    04/12/2023, 8:10 AM
    Good, now I'm sad!
1...987988989...1050Latest