You can mix methods across sides. Uploading the left file while giving a URL for the right is perfectly valid.
Method 1: direct upload
Send the file’s bytes as part of amultipart/form-data request. Use this when the document is on your server, was just uploaded by a user, or is generated on the fly and does not exist at any URL.
Method 2: source URL
Give Draftable a URL and it downloads the file directly.Requirements
The URL must be reachable by Draftable, from the public internet, without authentication.What happens if the download fails
Draftable attempts the download up to four times. If every attempt fails, the comparison is marked asfailed, and the error_message describes the download attempts.
This is worth knowing when debugging: a comparison that accepted cleanly and failed later is very often a source_url that Draftable could not reach. See Handling errors and comparison failures.
The best of both: pre-signed storage URLs
If your documents already live in cloud storage such as Amazon S3 or Azure Blob Storage, there is a better option than either of the above. Generate a pre-signed, single-use URL and pass that as thesource_url. Draftable downloads the file straight from your storage provider.
This avoids moving the data through your own servers entirely. Your application never downloads the file just to upload it again, which saves bandwidth, reduces latency, and removes your server as a bottleneck for large documents.
Which should you use?
Do not forget the file type
Whichever method you use,left.file_type and right.file_type are required. Draftable does not infer the type from the file name, the URL, or the content.
Declaring the wrong type is a common cause of failure, and the error often surfaces only in the viewer’s JavaScript console. Accepted values are pdf, doc, docx, docm, ppt, pptx, pptm, rtf and txt.

