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

    Jaex

    04/29/2022, 9:16 PM
    i can't test, i don't have access to r2
  • a

    andrew | 1003

    04/29/2022, 9:29 PM
    can't confirm exact size as I didn't go that detailed, but I have the same issue 🙂
  • v

    Vitali

    04/29/2022, 9:58 PM
    FML - yeah. For some reason we have a config bug that hasn't been solved
  • v

    Vitali

    04/29/2022, 9:58 PM
    Forgot about that one
  • v

    Vitali

    04/29/2022, 9:58 PM
    It should die closer to ~3GB (& does on the staging environment)
  • v

    Vitali

    04/29/2022, 10:14 PM
    Sweet - should be resolved. Try now
  • v

    Vitali

    04/29/2022, 10:16 PM
    If you try to upload > 6GB you'll get the HTML page again instead of a nice XML response "EntityTooLarge" error. Hopefully that'll be OK.
  • a

    andrew | 1003

    04/29/2022, 10:20 PM
    my 1GB upload that failed before just went through perfectly! thanks beelzabub!
  • d

    Deleted User

    04/29/2022, 10:20 PM
    mines still uploading o7
  • d

    Deleted User

    04/29/2022, 10:21 PM
    might be time to change my isp
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:21 PM
    That would take at least an hour to upload here
  • d

    Deleted User

    04/29/2022, 10:23 PM
    Takes me around like 5 minutes per test lol
  • d

    Deleted User

    04/29/2022, 10:24 PM
    an hour sounds... excruciating
  • a

    andrew | 1003

    04/29/2022, 10:24 PM
    lol my worker throws an exemption when i try to download said 1GB file from R2 😆
  • d

    Deleted User

    04/29/2022, 10:24 PM
    Workers are limited to 128mb or something around there
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:24 PM
    Oh yeah, Andrew.
  • a

    andrew | 1003

    04/29/2022, 10:24 PM
    yeah :/
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:24 PM
    That's if you're not streaming.
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:24 PM
    Try streaming it?
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:25 PM
    (as in, return the await get() directly, don't process it)
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:25 PM
    so like
    return await env.BINDING.get("filename")
  • i

    Isaac McFadyen | YYZ01

    04/29/2022, 10:25 PM
    Not sure if you even need to await.
  • a

    andrew | 1003

    04/29/2022, 10:25 PM
    when i get home i will have to try 👀
  • v

    Vitali

    04/29/2022, 10:32 PM
    That's correct. You really want to avoid calling `.text`/`.json`/`.array` etc on the resultant body unless you 100% know the size is small enough to be contained in ram. Depending on how many requests you're getting concurrently into the same metal, that could be anywhere from a few hundred kb to ~128MB. Otherwise make sure you're processing the file piecemeal in a streaming fashion. You can do passthrough. You can also construct a custom ReadableStream/WritableStream to pipe the data through and use
    readAtLeast
    to help you read a fixed amount of data at a time (that's how R2 works).
  • v

    Vitali

    04/29/2022, 10:35 PM
    All files are encrypted/decrypted at the edge for R2 with a Worker which means we have all the same design challenges. How do you encrypt and upload 5GB? How do you download a large file? In other words, as soon as you enter the front door of Cloudflare's network, your data is swaddled in encryption right away before being sent anywhere (in addition to being swaddled in encryption when being sent between you and Cloudflare).
  • j

    john.spurlock

    04/29/2022, 10:37 PM
    how are you able to do streaming digest calculating with bog-standard webcrypto?
  • v

    Vitali

    04/29/2022, 10:38 PM
    https://developers.cloudflare.com/workers/platform/changelog/#2021-12-10
  • v

    Vitali

    04/29/2022, 10:39 PM
    https://tenor.com/view/magical-magic-gif-13543499
  • j

    john.spurlock

    04/29/2022, 10:39 PM
    oh sweet i missed that
  • j

    john.spurlock

    04/29/2022, 10:40 PM
    wish that was standard
1...808182...1050Latest