Skip to main content

Module upload

Module upload 

Source

Structs§

FileUpload
A file uploaded straight from disk, without holding it in memory.
UploadPayload
A file to upload: its bytes and the name and type SmugMug records.
UploadRejected
SmugMug refused an upload with an HTTP error.
UploadResult

Enums§

UploadTarget
Who an upload goes to: a new image in an album, or new content for an existing image.

Constants§

LIBRARY_UPLOAD_URL
Upload endpoint for SmugMug’s Library (“All Media”): media uploaded here isn’t placed in any album/gallery. Not in SmugMug’s public API docs; discovered from the web uploader. It takes a multipart form (Media, ByteCount, Sha256Sum, optional Filepath/Title/Caption/ Keywords) and answers 201 with the standard v2 envelope ({"Response":{"Image":{...}},"Code":201}).

Functions§

parse_library_upload_response
replace_image
Replace the file content of an existing image, identified by its image URI (e.g. /api/v2/image/<key>). This uploads new bytes onto the existing image record, keeping its album placement, keywords, and other metadata, instead of creating a new image (which SmugMug rejects with 409 if an image with the same filename already exists in the album).
send_library_upload
Send the Library upload request and return the HTTP status and raw body, without interpreting either.
upload_bytes
Upload bytes held in memory (a JPEG rendered from a RAW file).
upload_file
Upload a file from disk, streaming its contents.
upload_image
upload_to_library
Upload a file to the Library (no album). filepath is sent as the Filepath field, which SmugMug describes as “the relative path to the photo or video itself on the uploader’s file system”.