# PDF.co uploads need get-presigned-url first: PUT to presignedUrl, pass url to the API

## TL;DR

PDF.co's upload is a three-step dance, and skipping a step is the most common integration bug. (1) GET `https://api.pdf.co/v1/file/upload/get-presigned-url?contenttype=application/octet-stream&name=[filename]` with your `x-api-key` header. (2) From the response, PUT your file bytes to `presignedUrl` with `content-type: application/octet-stream`.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

(3) Pass the response's `url` (not the presigned URL) as the `url` parameter to the conversion call. If your file is already on a public URL, skip all of this and pass that URL directly. Do not send file bytes or base64 to the conversion endpoints: they only take URLs.

Context: Web source (PDF.co official samples repo, pdfdotco/pdf-co-api-samples on github.com): PDF.co does not accept file bytes in conversion calls. You first GET /v1/file/upload/get-presigned-url?contenttype=application/octet-stream&name=[filename] (with the x-api-key header), which returns two URLs: `presignedUrl` for the upload and `url` for later API calls. Then PUT the file bytes to presignedUrl with content-type application/octet-stream, and pass `url` as the input to the conversion call.
