Upload: Clean up abandoned uploads and report failed processing
Author: lastzeroCreated Sep 29, 2026Updated Sep 29, 2026
Labelsplease-testuxupload
As a user uploading pictures through the web interface, I want to be told when my files could not be imported and to be able to retry, so that no upload is silently lost and abandoned uploads do not fill up storage.
Background
Files uploaded through the web interface are staged in the user's upload folder until the processing request imports them into originals. Before these changes, staged files of uploads that were never processed stayed in storage indefinitely. Processing also reported success even when the import could not run, for example while indexing was being canceled or storage was full.
Behavior
- Staged uploads that were never imported are removed once they have been unchanged for longer than
upload-maxage/PHOTOPRISM_UPLOAD_MAXAGE. The default is 7 days, the range is one day to 100 years, and-1keeps staged uploads. - Age is measured with the storage's own clock, so a NAS clock that differs from the host does not cause early removal.
- Cleanup runs in the background and does not block uploads while it removes large batches. A warning reports how many staged files that were never imported were removed.
- Processing answers 503 (busy), 507 (insufficient storage) or 500 when the import could not run or some files could not be moved to originals. The affected files stay staged.
- If the staged files no longer exist, processing answers 404.
- After 500, 503 or 507, the upload dialog shows "Upload failed" and offers Retry, which sends the processing request again without uploading the files again.
Acceptance Criteria
- MUST remove staged upload batches that have not changed for longer than
upload-maxage(default 7 days;-1disables removal) - MUST measure batch age with the storage's clock instead of the host's
- MUST NOT block upload or processing requests while large batches are removed
- MUST answer processing requests with 503, 507 or 500 instead of success when the import did not run or files could not be imported, and keep those files staged
- MUST answer 404 when the staged files no longer exist, without creating the upload folder again
- MUST offer a Retry action in the upload dialog after a failed processing request
- SHOULD document
upload-maxagein the user guide
Source: photoprism/photoprism