Skip to main content
Use occtoo media to upload files into a media source, give them properties from a spreadsheet, look at and delete assets, and convert images.

Upload files

  • --to names a media source, optionally followed by a folder: <SOURCE>/<FOLDER>. Leave it out in a terminal to pick the source and folder from a list.
  • A folder is uploaded with everything in it. photos/shoes/front.jpg goes into the folder photos/shoes below the destination. Folders the source doesn’t have are created. Hidden files are left out.
  • The entry key of a file is its name without the extension, so sku-123.jpg becomes the entry sku-123. Characters other than letters, digits, _ and - become -.
Uploading again is safe. A file whose name and size match what is stored is skipped, a changed file replaces what is there, and a run that failed halfway continues where it stopped.

Give files properties

Files get their properties from a metadata file: CSV or Excel, with one row per file. occtoo media manifest writes one for you to fill in by hand, in a spreadsheet or with a script:
  • file names a file by its name, or by as much of its path as tells it apart from the others.
  • key, when present, sets the entry key of the file.
  • Every other column is a property of the source, named and read as in occtoo sources import. Use title(en) for a value in one language.
  • An empty cell leaves a value as it is.
To give every file the same value, use --set:
A row in the metadata file wins over --set, and an empty value such as --set title= clears the property. The CLI checks everything before it sends the first file. A file that is already stored is not sent again, but still gets its properties. media manifest writes CSV to stdout. The key column holds the entry key each file would get. Change it to give a file another key.

Show and delete assets

show prints the state and public address of each asset. delete removes assets and the files behind them. Both take a media source id and one or more entry keys.

Convert images

Converts an image with one or more stored presets, or with parameters you give, and saves the result next to it. The result is named <name>-<preset>.<format>, or <name>-converted.<format> without a preset.

Conversion presets

A preset stores conversion parameters, so you can convert by name.
JSON for create. paddingPercent and background are optional:
  • Modes: Fit, FillBackground (needs paddingPercent), Crop, Auto.
  • Formats: Jpg, Png, Webp.
For edit, both displayName and parameters are optional. When you give parameters, they replace all current parameters.