Guides
Large files
Files over 64 MB are uploaded in parts of 16 MB. Each part has its own pre-signed URL; the server assembles them after confirmation. The limit per file is 150 MB.
How to recognise a multipart file
In the register response, the file has uploadType: "multipart", the part size (partSize), the number of parts (partCount) and the URL where you request each part (partUrlEndpoint). It has no uploadUrl.
{
"fileId": "f2",
"nume": "plan-fatade.pdf",
"uploadType": "multipart",
"partSize": 16777216,
"partCount": 7,
"partUrlEndpoint": "https://registrulcladirilor.graphit.ro/rndc/api/v1/documente/upload/<tx>/fisiere/f2/part-url"
}Upload the parts
For each part, from 1 to partCount:
- request its URL with
POST partUrlEndpointand the body{"partNumber": n}; PUTthe bytes of part n to that URL.
Parts can be uploaded in parallel. Finally, confirm the transaction with done, as for any upload.
split -b 16M -d -a 3 plan-fatade.pdf part-
n=1
for p in part-*; do
URL=$(curl -s -X POST "$PART_URL_ENDPOINT" \
-H "X-Api-Key: $API_KEY" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d "{\"partNumber\": $n}" | jq -r .url)
curl -sf -X PUT --data-binary @$p "$URL"
n=$((n+1))
done