Photo storage
Where Eleven Outfits stores catalog photos: inside the resource, on your own image host over HTTP or on a Discord webhook, plus the server.cfg convars.
Three modes
Catalog photos (the ones on the cards) are stored wherever Config.Photos.storage says:
| Mode | How it works | When to use it |
|---|---|---|
local (default) | Saved inside the resource, in outfit-catalog/photos/. | Zero setup. New photos reach players when the resource restarts. |
http | Uploaded to your image host; the URL it returns is stored. | Live catalog: everyone sees the photo straight away. |
discord | Uploaded to a Discord webhook. | Testing only: the links expire. |
Photos are WebP at 600 × 800 (change it in Config.Photo: outWidth, outHeight, quality).
Note
This is about catalog photos. The studio garment photos (/clothesphotos) always go to outfit-catalog/studio/ and are never sent to players.
Local mode
Config.Photos = {
storage = 'local',
-- ...
}
- Each photo is saved as
photos/<id>_<time>.webp. Every retaken photo is a new file, so the game never shows an older cached version. - FiveM only sends new files to players when a resource starts. A new photo shows up for everyone after restarting
outfit-catalog(or at the next server restart). Until then the card may show "No photo". - Old photos are not deleted. Clean
photos/now and then, but keep the ones the catalog uses: they are listed in thephotocolumn of theoutfit_catalogtable. - Do not delete the
photos/folder: the resource cannot create it.
HTTP mode
Each photo is uploaded to the URL you set as multipart/form-data, and the image URL your host returns is stored.
Config.Photos = {
storage = 'http',
timeoutMs = 20000,
http = {
url = GetConvar('outfitcatalog_http_url', ''),
headers = {}, -- extra headers that are NOT secret
field = 'file', -- name of the file field
responsePath = 'url', -- where the URL sits in the JSON answer
},
}
And in server.cfg:
set outfitcatalog_http_url "https://your-image-host/upload"
set outfitcatalog_http_authorization "YOUR_API_KEY" # sent as the Authorization header
| Key | What it is |
|---|---|
url | Upload URL. Comes from the outfitcatalog_http_url convar. |
headers | Extra, non-secret headers. The API key goes in the outfitcatalog_http_authorization convar, which is added as Authorization. |
field | Name of the file field in the form (file, image...). Check your host's docs. |
responsePath | Dot-separated path to the URL in the JSON answer. Examples: url, data.url, data.image.url. List indexes start at 1: files.1.url. |
timeoutMs | Maximum upload time (20 s by default). |
The answer must be a 2xx status and the path must lead to a URL starting with http:// or https://. Otherwise the photo is rejected and the server console shows the HTTP status.
Tip
Your host must allow its images to be shown from other sites (direct image links). Players load them from the catalog UI.
Discord mode
Config.Photos = {
storage = 'discord',
-- ...
}
set outfitcatalog_discord_webhook "https://discord.com/api/webhooks/<id>/<token>"
Warning
Discord signs its CDN links and they stop working after a while (about a day). Cards would end up without photos. Use it for testing, not for a live catalog: pick local or http.
Keep secrets out of config.lua
config.lua is sent to every player. Never write a webhook, a private URL or an API key in it. Put them in server.cfg with these convars, which players never receive:
| Convar | Used for |
|---|---|
outfitcatalog_discord_webhook | Webhook for discord mode. |
outfitcatalog_http_url | Upload URL for http mode. |
outfitcatalog_http_authorization | API key for http mode (Authorization header). |
If you pick discord or http and its convar is empty, a warning shows in the server console at start and photos cannot be stored.