The upload form atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hxmz-axfn07/qr-printing-sfw/llms.txt
Use this file to discover all available pages before exploring further.
/upload is where customers build their print order. It is a single-page form (served from client/upload.html, driven by client/upload.js) that lets a customer add multiple files in one submission, configure independent print settings for each file, preview a live order summary, and send everything to the server in one click. No account is required.
Customer Details
The top section of the form collects contact information for the order.The customer’s full name. Used by staff to identify the order on the dashboard
and call the customer when their prints are ready. Defaults to
"Walk-in customer" on the server if left blank.Phone number. Optional but recommended so staff can contact the customer.
Accepts any format — no validation is applied client-side.
Free-form order-level notes visible to staff. Use this for instructions that
apply to the entire order, for example
"Need urgently" or
"Staple all files together".File Cart
Below the contact fields is the File cart section. It starts with one blank file slot and grows as the customer adds more documents.Adding documents
When the page loads,upload.js fetches GET /api/config to retrieve the available print options, then immediately calls addDocument() to render the first file slot:
addDocument() again for each additional document. Each call clones the <template id="documentTemplate"> element and appends the resulting card to the #documents container. The color mode and print style <select> menus are populated from the live config response, so the options always match what the shop has configured.
Per-Document Print Options
Each file card contains its own set of print options. These are configured independently per file, so a customer can print one document in color and another in black and white within the same order.The document to print. Accepted formats include PDF, DOC, DOCX, XLS, XLSX,
PPT, PPTX, images, and other common print file types as listed in
shop.supported_file_types. The file is uploaded as part of the
documents multipart field.Controls whether the document is printed in black and white or color.
Options are drawn from
| Value | Label |
|---|---|
bw | Black & white |
color | Color |
options.color_modes in config.yml.Controls single-sided or double-sided (duplex) printing.
Options are drawn from
| Value | Label |
|---|---|
single | Single side |
double | Double side |
options.print_styles in config.yml.Number of copies to print. Must be between 1 and 99 (enforced both
client-side via
min="1" max="99" and server-side with
max(1, min(99, int(...)))). Defaults to 1.Per-file freeform instruction for staff. For example:
"Print pages 1-10 only" or "Use thick paper".Live Order Review
As the customer fills in the form, a live Order review panel updates automatically below the file cards. Everychange and input event on any document card triggers refreshReview():
Submitting the Order
When the customer taps Submit order, the form’ssubmit event is intercepted by upload.js. The buildFormData() function assembles a multipart/form-data payload and POSTs it to POST /api/orders:
HTTP 201 Created) the browser redirects to /success?id=<order-id>, where the UUID order ID is displayed for the customer’s reference.
If an error occurs (e.g. a file exceeds the size limit, or no file was attached) an inline error message is shown in red beneath the form without navigating away.
Multipart field naming convention
buildFormData() uses the following field names. Per-document fields are zero-indexed to match the order each file was added:
fields.get(f"color_mode_{index}"), etc.) to match options back to the right uploaded file.
The upload form does not include a paper size selector. The server assigns
every document a paper size of
A4 by default
(fields.get(f"paper_size_{index}") or "A4"). Staff can adjust the paper
size from the admin dashboard during order review.