Skip to main content

presign_part

Function presign_part 

Source
pub fn presign_part(
    ctx: &Ctx,
    key: &str,
    upload_id: &str,
    part_number: u16,
    expires_in: u64,
) -> Result<String>
Expand description

Presigns the PUT of part part_number of the multipart upload upload_id of key, valid expires_in seconds.

The uploader PUTs the part’s bytes to the URL; R2 answers its ETag (also found later with list_parts). In debug builds the URL is the app’s development route on the local bucket. Signing is local: no R2 operation.

§Errors

  • Error::BadRequest (400) when part_number is not 1 to 10,000.
  • Error::Internal (500) when an R2_* setting is missing in a release build, or expires_in is 0 or over 7 days.