Store product images in filepacks
A filepack
groups files under a single .fp path in the Lokad file explorer.
This guide imports product images into /catalog/images.fp and uses their
entry paths in a dashboard. Import images through a configured transfer
project, import an archive through Studio, or pack a folder already in Lokad.
You need permission to read the sources and write the destination pack and
entry paths.
Split collections larger than 65,535 entries across packs. Keep each relative entry path within 256 UTF-8 bytes, including subfolders and the filename.
Import the images
For images hosted on a public website or CDN, first configure an HTTPS transfer project.
In the project’s transfer instructions,
use GET with a destination below the .fp path:
Source,Destination,Action,Flags
/remote/images/item.png,/catalog/images.fp/item.png,GET,
Source is on the configured remote server; Destination is in Lokad.
For a connection that supports folder downloads, use:
Source,Destination,Action,Flags
/remote/images/,/catalog/images.fp/,GET,
HTTPS requires one GET instruction per source file; it cannot download a
source folder recursively.
Run the transfer project. The file explorer contains /catalog/images.fp;
item.png is an entry inside it, not a separate file beside the pack.
Subfolders are retained in entry paths, such as
/catalog/images.fp/shirts/blue.png.
Import an archive through Studio
If the images are in a ZIP, TAR, TAR.GZ or TGZ archive accessible in Studio,
ask the assistant to import the archive into a filepack. For example, ask it
to import /incoming/products.zip into /catalog/images.fp. Review and
accept the proposed change to publish the pack.
Paths inside the archive are preserved. For example, shirts/blue.png
becomes /catalog/images.fp/shirts/blue.png. To replace an existing pack,
ask the assistant to replace the entire pack.
Pack images already in Lokad
If the images are already in /catalog/images/, open that folder’s details
and select Pack folder. This creates /catalog/images.fp with the files
you can access, including subfolders, and preserves the source files. It
replaces any existing file at the destination. The account root cannot be packed.
Create packs in the account where you will use them. To move images to
another account, transfer the source files there and rebuild the pack.
Downloading or sharing the .fp file alone copies only its index.
Check the pack
Open the .fp file’s preview to list entry paths and sizes. Use
Path starts with to filter the list, and Download to retrieve an
individual entry.
Display and preview an image
Once the entry exists, pass its full path to
downloadUrl to display it in an image
tile. Use previewUrl for a link that
opens its preview:
path = "/catalog/images.fp/item.png"
show image "Product image" { 1..3, 1..4 } with downloadUrl(path)
show table "Image preview" { 1..3, 6..7 } with
"Preview" { href: #(previewUrl(path)) }
The path-based preview link resolves the current entry when opened, so it follows later image updates. Access to an entry still depends on the user’s file permissions. Permission to view selected entries does not necessarily grant permission to download the entire pack.
Update entries without replacing the pack
Writing to /catalog/images.fp/item.png replaces that entry and preserves
the others. Writing directly to /catalog/images.fp replaces the whole file;
it does not insert an image into the pack. The entry-path convention also
applies to file uploads and other applications writing files in Lokad.
With a transfer project, successful downloads are committed even if other downloads fail; failed entries retain their previous content. Cancellation publishes no update. Check the transfer result before treating the pack as fully refreshed.
Do not use the Newer transfer flag for packed destinations: entries do not
have individual modification dates. A filepack is not a local source folder
for PUT, and transfer DELETE targets the remote server, not pack entries.
To read image dimensions or compute visual similarity in Envision, use
read images. Packed entries are not
general-purpose read inputs.