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

    Erisa | Support Engineer

    04/22/2023, 2:14 AM
    all kinds of request errors come up as CORS issues which is >.> to debug
  • c

    chientrm

    04/22/2023, 4:08 AM
    I
    putObject
    with metadata using aws sdk. However, when I
    get
    on worker,
    customMetadata
    is an empty object.
  • c

    chientrm

    04/22/2023, 4:58 AM
  • c

    chientrm

    04/22/2023, 5:17 AM
    maybe
    getPresignedUrl
    doesn't work with
    Metadata
    ? 🤔
    Copy code
    ts
    const url = await getSignedUrl(
      s3Client,
      new PutObjectCommand({ Bucket, Key, Metadata }),
      { expiresIn: 60 }
    ),
      stats = fs.statSync(path),
      body = fs.createReadStream(path);
    return await fetch(url, {
      method: "PUT",
      headers: { "Content-length": stats.size.toString() },
      body,
    });
  • s

    samon

    04/22/2023, 6:54 AM
    is there any chance to delete an object from r2 in node js ?
  • k

    Karew

    04/22/2023, 6:57 AM
  • s

    samon

    04/22/2023, 7:00 AM
    thnks but here i can see all delete actions are in red ,😅
  • s

    samon

    04/22/2023, 7:00 AM
    https://developers.cloudflare.com/r2/api/s3/api/
  • k

    Karew

    04/22/2023, 7:01 AM
    DeleteObject is supported, the ❌ on the right are showing that certain AWS-specific headers are not supported
  • k

    karimfromjordan

    04/22/2023, 8:32 AM
    How would you limit the file upload size with presigned URLs?
  • s

    Skye

    04/22/2023, 8:35 AM
    If you sign the content length header too, it has to be exactly that file size, otherwise the upload would fail
  • s

    Skye

    04/22/2023, 8:36 AM
    This would require whatever's doing the signing to receive that size of course, but that's doable in a lot of cases
  • k

    karimfromjordan

    04/22/2023, 8:42 AM
    Thank you. I'll try this out.
  • c

    chientrm

    04/22/2023, 11:20 AM
    Anyway I can log R2 object streaming from Worker? I want to log range header, offset and content length 😃
  • h

    HardAtWork

    04/22/2023, 12:17 PM
    Console log and then LogPush it?
  • h

    HardAtWork

    04/22/2023, 12:17 PM
    Or wait
  • h

    HardAtWork

    04/22/2023, 12:17 PM
    #981314061268578304 maybe?
  • c

    chientrm

    04/22/2023, 12:59 PM
    it's a playback service, the stream can last to hours 🤔
  • p

    Plotzes

    04/22/2023, 1:06 PM
    hey everyone i have a ton of files with dash-less uuid as name and i actually want to put them all in a "folder" and thus basically rename them from
    <uuid>
    to
    uuid/<uuid>
    . does anyone know an easy way to do this with rclone for example?
  • p

    Plotzes

    04/22/2023, 1:07 PM
    or do i need to write a worker that does this and manually call it a few times
  • p

    Plotzes

    04/22/2023, 1:07 PM
    im hoping rclone has a feature where you can bulk rename files based on regex name matching or smt
  • p

    Plotzes

    04/22/2023, 1:07 PM
    idk
  • h

    HardAtWork

    04/22/2023, 1:13 PM
    I mean, LogPush isn’t dependent on the duration of the Worker
  • c

    chientrm

    04/22/2023, 1:13 PM
    imma try
  • s

    Sid | R2

    04/22/2023, 1:16 PM
    I think you should be able to do an “rclone copy/move” with both the source and destination set to the same bucket? It can do entire “folders” too I think.
  • h

    HardAtWork

    04/22/2023, 1:25 PM
    Yup, you can do that. Would be cool to do automated transfers with R2 too.
  • h

    HardAtWork

    04/22/2023, 1:26 PM
    So like, if I have a few thousand files(or multiple gigabytes of files), I can tell CF to migrate them from one folder to another, or one bucket to another, without spinning up a VPS.
  • s

    Sid | R2

    04/22/2023, 1:26 PM
    Like a Super Slurper R2<>R2 migration!
  • h

    HardAtWork

    04/22/2023, 1:28 PM
    Yeah. SuperSlurper with any S3-compatible storage would be cool. You could also use it as manual region migration, for until the actual auto-migrator comes out.
  • p

    Plotzes

    04/22/2023, 1:46 PM
    i can't seem to get it working. I also tried it with the
    --include
    and
    --exclude
    parameters instead of the
    --filter
    parameter but i get the same error
    s
    • 2
    • 17
1...9989991000...1050Latest