Skip to main content

put_presigned_upload

Function put_presigned_upload 

Source
pub async fn put_presigned_upload<S: BuildHasher>(
    url: &str,
    headers: &HashMap<String, String, S>,
    file: File,
    size_bytes: u64,
) -> Result<()>
Expand description

PUT file to a presigned storage url with exactly headers (gh#193).

Deliberately a fresh reqwest::Client, not TaskFastClient::http_client: that one carries X-API-Key as a default header, which must never reach a storage host. Redirects are off for the same reason as in TaskFastClient::from_api_key. No total timeout, since a 200 MB video on a slow link legitimately runs long. The body streams from disk with an explicit Content-Length, because S3-style presigned PUTs refuse Transfer-Encoding: chunked.