Libraries

Uploading

Getting photos and videos into a library, from the browser or with the API.

Uploading is how media gets into a library.

From the browser

Choose Upload in the top bar. It's there on every page in a library. On the dialog's left, drop pictures and videos, or whole folders, or use Choose files or Choose a folder to pick them. A folder brings everything in it, and in the folders inside it. They go into the library you're in, named in the dialog's title.

The dialog's right half lists every file, with the folder it came from and how it's going, and uploads a few at a time. Above the list:

  • How many have been added so far, and a bar for the whole upload.
  • All, Going, Added, Failed and Skipped, each with its count, to see just those.

Next to each file, ✕ cancels it (it's never sent, or it stops where it is), and ↻ tries one that failed or was cancelled again. Under the list, Cancel the rest stops everything still to go, Try the failed again retries them all, and Clear what's finished takes added, skipped and cancelled files off the list. However many files there are, the list stays quick: it only draws the rows you can see.

You can close the dialog while it works and carry on browsing, even to other pages: the uploads keep going, and the Upload button shows how many are left with a ring that fills as they go. When they're done, a message says how many were added. If any failed, it has a See why button that opens the dialog with the reasons. Leaving the app while uploads are still running (reloading, switching library, closing the tab) asks first, as it would cut them off.

New media doesn't jump the list

While an upload runs, new media doesn't push the page around. When some has arrived, a New button appears at the top of the list with how many; click it to show them. This is the same everywhere lists change underneath you: see Live updates.

What happens next

Each file appears as soon as it's stored, first as a blurry placeholder, then with its thumbnail a few seconds later, once the metadata and renditions steps have run. Tags, descriptions, faces and the rest follow as their steps finish. See Processing steps.

What's accepted

JPEG, PNG, WebP, AVIF, TIFF, GIF, MP4, WebM and MOV; the dialog says so too. Anything else isn't sent: it's listed under Skipped, with its type, so a folder with documents or system files in it uploads what it can and shows you what it left. HEIC and RAW aren't supported yet. See S3 libraries.

There's no fixed size limit. Uploads stream straight to storage, so a large video uses no more memory than a small photo. A reverse proxy in front of Hubstruct may have its own limit; see HTTPS and a domain.

With the API

Upload a file by sending it as the request body, with its name in the query string:

Terminal
curl -X POST \
  -H "Authorization: Bearer $HUBSTRUCT_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @IMG_2041.jpg \
  "https://hubstruct.example.com/api/libraries/$LIBRARY_ID/media/upload?filename=IMG_2041.jpg"
  • Content-Type must be the file's type, such as image/jpeg or video/mp4.
  • The answer is the new media, with its id.
  • Make an API key in your Profile. See API keys.

A small script can upload a folder:

Terminal
for f in ~/Pictures/trip/*.jpg; do
  curl -sS -X POST \
    -H "Authorization: Bearer $HUBSTRUCT_API_KEY" \
    -H "Content-Type: image/jpeg" \
    --data-binary @"$f" \
    "https://hubstruct.example.com/api/libraries/$LIBRARY_ID/media/upload?filename=$(basename "$f")"
done

Duplicates on upload

Hubstruct doesn't refuse a file it already has. The duplicate check runs on every upload and lists any copies on the Duplicates page, where you choose what to keep. See Duplicates and stacks.