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

    kian

    04/03/2023, 8:15 PM
    It does, since they're uploaded
  • k

    kian

    04/03/2023, 8:16 PM
    The checksum isn't an MD5 digest of the uploaded object though.
  • k

    Karbust

    04/03/2023, 8:18 PM
    It uses multipart by default for files above 16MB
  • k

    Karbust

    04/03/2023, 8:20 PM
    When I said the MD5 doesn't match the local one I meant this:
    Copy code
    csharp
                    var getObjectMetadata = await s3client.GetObjectMetadataAsync(new GetObjectMetadataRequest()
                    {
                        Key = fileKey,
                        BucketName = settings.CloudflareR2BucketName,
                    });
                        
                    if (getObjectMetadata.ETag == $"\"{md5}\"")
                    {
                        Console.WriteLine($"File {fileName} already exists in the bucket with the same MD5 hash [{md5}].");
                        exists = true;
                    }
  • k

    Karbust

    04/03/2023, 8:20 PM
    Is that incorrect?
  • k

    Karbust

    04/03/2023, 8:23 PM
    If I download the file from R2 it has the same MD5 has the local file
  • k

    kian

    04/03/2023, 8:27 PM
    If you're saying that the
    ETag
    property is not the MD5 of the object, that is expected with multipart uploads.
  • k

    Karbust

    04/03/2023, 8:27 PM
    yeah, the etag isn't the MD5... https://stackoverflow.com/a/7347257/4744560
  • k

    Karbust

    04/03/2023, 8:28 PM
    do you have any idea on how to achieve this on multipart uploads?
  • n

    Noel

    04/03/2023, 8:30 PM
    is there a difference between
    <bucket>.<account-id>.r2.cloudflarestorage.com
    and
    <account-id>.r2.cloudflarestorage.com/<bucket>
    , should i prefer one over the other?
  • k

    kian

    04/03/2023, 8:32 PM
    Nope, just different styles of addressing the same bucket
  • n

    Noel

    04/03/2023, 8:34 PM
    okay, i thought the first got deprecated or something since i couldn't find that representation except in an older env variable
  • k

    Karbust

    04/03/2023, 8:35 PM
    Looks like I'm gonna be saving the MD5 checksum in the file's metadata
  • h

    HardAtWork

    04/03/2023, 8:40 PM
    What is the checksum based off of? I know when I rclone it can check against something, but is it using a different hash, or something else
  • k

    Karbust

    04/03/2023, 8:42 PM
    Apparently, on multi-part uploads the etag isn't the MD5 checksum: > ETag is a MD5. But for the Multipart uploaded files, the MD5 is computed from the concatenation of the MD5s of each uploaded part. So you don't need to compute the MD5 in the server. Just get the ETag and it's all. https://stackoverflow.com/a/61861691/4744560
  • h

    HardAtWork

    04/03/2023, 8:43 PM
    Interesting
  • k

    Karbust

    04/03/2023, 8:44 PM
    Yeah, I wasn't aware of that either xD
  • i

    ickerio

    04/04/2023, 1:39 AM
    Haha thanks for the explanation but it was a joke! Should’ve made that more clear. I well and truely agree that it’s the right decision to not include and delete all
  • a

    ArnaudLanna

    04/04/2023, 2:42 AM
    I'm trying to migrate some objects from other provider to R2, using rclone, but for some reason the API keeps returning me "Unauthorized" randomly
  • a

    ArnaudLanna

    04/04/2023, 2:42 AM
    Just running a simple list on the root directory is inconsistent
  • a

    ArnaudLanna

    04/04/2023, 2:43 AM
    Any idea on what could be causing this?
  • a

    ArnaudLanna

    04/04/2023, 2:43 AM
    Copy code
    2023/04/04 02:40:30 ERROR : : error listing: Unauthorized: Unauthorized
            status code: 401, request id: , host id:
    2023/04/04 02:40:30 Failed to lsf with 2 errors: last error was: error in ListJSON: Unauthorized: Unauthorized
            status code: 401, request id: , host id:
  • a

    ArnaudLanna

    04/04/2023, 2:47 AM
    Well, I created a fresh pair of keys and the error went away
  • r

    rbravo

    04/04/2023, 4:46 AM
    Hey! I'm trying to upload a pdf to a cloudflare worker binded with R2 from my nextjs api backend... Do I need to use something like multer of formidable to handle multi part upload?
  • r

    raiyansarker

    04/04/2023, 2:52 PM
    ?r2-roadmap
  • h

    Helpflare

    04/04/2023, 2:52 PM
    > These features are now available!! > - **Object Lifecycles**: > - Public buckets, with custom domains: > - Presigned URLs in the S3-compatible API > > Future roadmap > Read more: > - Jurisdictional Restrictions (e.g. 'EU') > - Live Migration without Downtime (S3->R2)
  • c

    Cryptex

    04/04/2023, 6:20 PM
    does each public bucket access counts as a class B operation
  • k

    kian

    04/04/2023, 6:20 PM
    If it's a cache miss, yes.
  • k

    kian

    04/04/2023, 6:20 PM
    Most requests from the same location to the same object, if at the same time, will be cached.
  • s

    steele

    04/04/2023, 6:20 PM
    am i dumb or why is my r2 bucket caching its 404?
1...975976977...1050Latest