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

    chickenmatty

    05/25/2023, 7:22 AM
    Hi, is there any way to set a max upload size? I'm using presigned urls with the js sdk and unfortunately the Content-Length is not an option for me as I don't know the actual file size
  • l

    luisco

    05/25/2023, 7:26 AM
    can I use R2 for personal computer backups? I am using DigitalOcean Spaces, but I would like to use R2
  • h

    HardAtWork

    05/25/2023, 7:41 AM
    You can if you want
  • b

    BitSwed

    05/25/2023, 9:10 AM
    Hello people, I've tried googling, but can't seem to find any information if versioning is planned for R2 objects any time soon?
  • k

    kian

    05/25/2023, 9:34 AM
    https://discord.com/channels/595317990191398933/1095339332669288551/1105797309595389973
  • b

    BitSwed

    05/25/2023, 9:54 AM
    Thanks Kian, i guess were no updates on this during developer week.
  • u

    1234qwerty

    05/25/2023, 10:18 AM
    Try doing the logic of whether or not the file is acceptable via a worker, will be cheap/efficient to do so, unfortunately you can't trust the browser
  • c

    chickenmatty

    05/25/2023, 10:22 AM
    That was my last resort, I was hoping to find something with less overhead but I guess that's the only way until ACLs are implemented. Thanks!
  • i

    I love cf

    05/25/2023, 11:18 AM
    Can you rename object or directory?
  • s

    Sid | R2

    05/25/2023, 12:36 PM
    No, but you can copy an object to a different key, and then delete the original.
  • k

    kev-ac

    05/25/2023, 1:53 PM
    I've stumbled across this message here, because I discovered a similar issue today, but not with pre-gzipped content, but just plain txt files. https://discord.com/channels/595317990191398933/940663374377783388/1086136363352596500 Chrome gives a "net::ERR_CONTENT_DECODING_FAILED 200 (OK)" error. Test file: https://pub-7e722c392cb24f389b2941db8812a3f0.r2.dev/test-files/file_4m.txt The files in question were uploaded in January 2023. It worked for some time, I don't know how long. Just noticed it because the part of the application is broken which uses this files.
  • k

    kian

    05/25/2023, 2:00 PM
    I'm not entirely sure what encoding (if any) that is
  • k

    kev-ac

    05/25/2023, 2:12 PM
    The file content is just random output from /dev/urandom or something similar. We only use it's known size to measure the rough internet speed of a user.
  • k

    kian

    05/25/2023, 2:13 PM
    Isn't this a case of Chrome (or any browser really) being told it's
    text/plain
    when it isn't?
  • k

    kev-ac

    05/25/2023, 2:14 PM
    Could be, but why should it break randomly? And as a counter argument: I've downloaded the files from the Dashboard and reuploaded them. They work fine
  • k

    kev-ac

    05/25/2023, 2:14 PM
    Also with content-type
    text/plain
    . https://pub-7e722c392cb24f389b2941db8812a3f0.r2.dev/test-files/test-files_file_4m.txt
  • k

    kian

    05/25/2023, 2:20 PM
    The ETag is identical (other than one being weak) but the lack of
    Content-Length
    on the broken one would lead me towards an issue with transparent (de)compression.
    Cache-Control
    is present on the broken one but doesn't specify
    no-transform
    , I have no idea if `no-store`/`no-cache` influence it.
  • k

    kian

    05/25/2023, 2:20 PM
    The R2 team should be able to tell you if there's been a change/regression in that area when they're next here
  • k

    kev-ac

    05/25/2023, 2:22 PM
    Thanks for looking into it @kian . Is there something I could have f'ed up here? If I remember correctly I've uploaded both versions via the Dashboard.
  • k

    kian

    05/25/2023, 2:22 PM
    Nothing on the response headers looks wrong to me - I'd keep the broken file around in the bucket if you can so they can take a look at it
  • k

    kev-ac

    05/25/2023, 2:26 PM
    Will do. Those 100MB will certainly not make any noticeable difference in my invoice. 😁
  • s

    SuperVisor_16

    05/25/2023, 3:57 PM
    Hey, someone knows how R2 bills look like? Is there is showing overall sum or if I have 2 or more buckets there is separation to have an understanding of which bucket how much you spent in the previous month
  • R2 error "net::ERR_CONTENT_DECODING_FAILED 200 (OK)"
    s

    Sid | R2

    05/25/2023, 4:01 PM
    Have you created a ticket already? If not, can you do so so it can be escalated? That broken file might be of help too!
    k
    • 2
    • 6
  • u

    Unsmart | Tech debt

    05/25/2023, 4:15 PM
    Not sure if the bill has it split out but the GQL API lets you get this info:
    Copy code
    gql
    query {
      viewer {
        accounts(filter: { accountTag: "<your account id>" }) {
    
          r2OperationsAdaptiveGroups(
            filter: {
              date_geq: "2023-04-01",
              date_leq: "2023-04-30"
            },
            limit: 10000
          ) {
            dimensions {
              bucketName
              actionType
            }
            sum {
              requests
            }
          }
    
          r2StorageAdaptiveGroups(
            filter: {
              date_geq: "2023-04-01",
              date_leq: "2023-04-30"
            },
            limit: 10000
          ) {
            dimensions {
              bucketName
              date
            }
            max {
              metadataSize
              payloadSize
            }
          }
    
        }
      }
    }
  • u

    Unsmart | Tech debt

    05/25/2023, 4:16 PM
    (Note that storage groups has the date dimension there because it is
    peak storage size each day / number of days
    in the month)
  • s

    SuperVisor_16

    05/25/2023, 4:21 PM
    Is there is a way to get that using S3 API/REST API, I'm not familiar with GQL API
  • u

    Unsmart | Tech debt

    05/25/2023, 4:22 PM
    Not that I know of but GQL is basically just a json interface and the query I sent is exactly what you would run 🤷 Writing GQL is actually very very easy especially if you use a GQL client that has auto complete and pulls up the docs in a side panel for you.
  • c

    Chaika

    05/25/2023, 4:23 PM
    There's an undocumented (use at your own risk) /usage endpoint for the bucket that returns current size (which wouldn't exactly correspond to your bill since it's just now and not peak daily usage), but other then that, it's all GraphQL. The dashboard itself uses GraphQL to pull the Class A/Class B Operations, and all of the metrics
  • i

    I love cf

    05/25/2023, 4:32 PM
    How to add metadata, such as Cache-Control: max-age to R2 files? Currently I'm using rclone to upload files.
  • s

    SuperVisor_16

    05/25/2023, 4:54 PM
    Where I can get documentation for r2StorageAdaptiveGroups, r2OperationsAdaptiveGroups and if there is more?
1...10461047104810491050Latest