
Resume an interrupted Imagild result download by requesting the missing byte range from the same owned task-content resource. Append bytes only after validating a 206 response and its Content-Range. A 200 response is a complete representation, while 416 means the requested range cannot be satisfied; neither should be blindly appended to an existing file.
Key Takeaways
- Keep the original task ID and reliable partial-file byte count.
- Validate status, range start, total size, and fragment length before assembly.
- If resource identity is uncertain, restart a full download instead of mixing representations.
Preserve a download manifest
Before resuming, identify the task, account, destination, and number of bytes already stored. Use the partial file's actual size rather than a progress label from the UI.
Confirm that the task succeeded and still exposes the intended result. Authorization requires a valid key and active membership, even if the first download worked earlier.
MDN's Range documentation explains byte-offset requests and partial-response semantics. Imagild's content route supports a single byte range; do not assume multipart-range delivery or an undocumented If-Range validator.
Fetch a separate remainder
This POSIX shell example assumes curl, a known task ID, and an existing result.part. It saves the response separately so an error page or full response cannot corrupt the original partial file.
test -s result.part || exit 1
BYTES_HAVE=$(wc -c < result.part | tr -d ' ')
HTTP_STATUS=$(curl --silent --show-error \
--connect-timeout 10 --max-time 60 \
--range "$BYTES_HAVE-" \
--dump-header resume.headers --output remainder.part \
--write-out '%{http_code}' \
"https://imagild.com/api/relay/v1/tasks/$TASK_ID/content" \
-H "Authorization: Bearer $IMAGILD_API_KEY") || exit 2
printf 'Status: %s; existing bytes: %s\n' "$HTTP_STATUS" "$BYTES_HAVE"
The local sixty-second transfer budget is not a completion guarantee. On transport failure, retain the manifest and existing partial file; do not append an unverified remainder automatically.
Use the API console for current access and download instructions. No fresh generation is needed merely to repair a broken download.
Interpret the range response before assembly
| Response | Safe next action |
|---|---|
| 206 with expected start | Validate fragment and total before combining |
| 206 with unexpected start or inconsistent total | Stop; investigate identity and proxy behavior |
| 200 | Treat as full response; do not append |
| 416 with total size | Compare saved size and requested offset |
| JSON access error | Restore authorized access; do not treat it as media |
For a requested start N, Content-Range should describe a range starting at N. The fragment's byte count must equal its declared end minus start plus one. For an open-ended remainder, the end should reach the declared total minus one.
Once those checks pass, combine into a new temporary destination rather than overwriting the only partial copy. Verify the resulting total and decode the media before promoting it to the final filename.
Treat 416 as a diagnostic
A partial file whose size equals the advertised total might already be complete, but verify it. A file larger than the current total may belong to another representation or have been corrupted by an earlier full-response append.
A matching total alone does not prove identical content. If you cannot establish that the partial bytes belong to the same result, obtain a fresh full representation. Do not invent a server checksum, ETag, or permanent file identity contract that the API has not supplied.
The HTML-download diagnostic is useful when a “partial image” is actually saved JSON or HTML.
Close delivery without changing the creative operation
After a successful verified assembly, record the final byte count and your own checksum. Archive approved media according to your policy; see the asset archive guide.
The model market describes prices for new generation. A network interruption is a delivery problem, not permission to submit another paid candidate. Keep the task and its original operation identity intact while repairing the download.
Related tasks
- Why Does My Downloaded Image Open as a Web Page?
- How to Archive Imagild Assets Before the 90-Day Storage Window Ends
Sources and scope
- Imagild API console: Authenticated task content and membership requirements.
- Imagild model market: Generation pricing concerns separate new work, not delivery retry identity.
- MDN Range requests: Single byte ranges, Content-Range and 200/206/416 response meanings.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.