Photos, Manuals and Receipts
Attaching the evidence to the record — and the honest story of how the files are stored, including the upload that failed three times in this guide's own lab.
A record that says "mixer, 249.99" is a claim. A record with a photograph of the mixer on your counter, the receipt from the shop, and the manual's PDF is evidence. HomeBox lets you attach files to any item, and names the kinds it expects: photo, manual, warranty, receipt, and plain attachment. One photo can be marked primary — it becomes the item's face in the lists.
The lab attached a small test photo to
its stand mixer as the primary photo.
The item then reported an image ID, and
the file itself was found on disk and
checked: the stored copy is
byte-for-byte the file that was
uploaded — same length, same SHA-256
sum (transcripts t15–t16 and the
file result quoted there: the 8×8 PNG
went in, and an 8×8 PNG is what the
store holds).
How the files are stored
Uploaded documents do not go into the
database. They live in the document
store as ordinary files, under a folder
per household, in a documents
directory, each named by a hash of its
contents, with a small sidecar file of
attributes beside it (transcript t21).
Three consequences worth knowing:
- Identical files are stored once, however many items link to them.
- The database and the document store are both the backup. One without the other is a list without photos, or photos without a list. Chapter 14 returns to this.
- The file names tell you nothing; the catalogue in the database is the only index. Treat the pair as one system.
The upload trap
The lab's first three attempts to
attach that photo failed, and the
reason is a real one worth a paragraph
in any install that separates its
temporary files from its data: the
program stages an upload in the
system's temp folder, then moves it
into the document store. If those two
folders live on different
filesystems, the move fails with
invalid cross-device link, and the
attachment simply never happens
(transcripts t12–t14). The cure is to
give the program a temp location on the
same filesystem as its data — in the
lab, pointing the storage at the same
disk as the temp folder made the
identical upload succeed at once
(transcript t15). On a single-disk home
server this never arises; in
containers and split-disk installs it
is the first thing to check when
uploads fail while everything else
works.
One more honest note. Retrieving the
file back through the API routes the
lab tried answered with errors in this
build, even though the upload and the
on-disk verification succeeded; the web
pages fetch attachments through their
own route using the attachment token
from login. The guide therefore claims
the upload and the storage as proven,
and the API download as not
demonstrated — the ledger in
criteria.md keeps the distinction.
The check for this chapter: attach a photo to one item, then find the new file under your document store and confirm it opens. Storage you have not looked at is storage you are hoping about.