Skip to main content
⚠️ Archived Version

You are viewing documentation for Preflight version 1.26, which is no longer actively maintained. For the latest features and updates, please refer to the current version (2.0).

Upload

To validate that print files are compatible with your printing equipment, you must first upload them to your server. The POST ~/api/files/upload endpoint allows for uploading a print file.

Example call

You can pass and upload a file as follows:

<input type="file" id="file" onchange="upload(event)"/>
...
const upload = async (event) => {
const file = event.target.files[0];
const formData = new FormData();
formData.append('file', file);

const response = await fetch(appUrl + "api/files/upload?dpi=200", {
method: "POST",
body: formData
});
console.log(await response.json());
}

Success response

As a result, you get the GUID that your print file obtained after saving it on the server.

Status Code: 200 OK
Content:
[
"425a3537-2e59-450d-bbc2-484fcd3d63bd.pdf"
]
Was this page helpful?