Prerequisites
- Set up FiveMesh CDN and install the FiveMesh SDK with an API key that has
cdn:write. - If your key has path restrictions, allow the
screenshotsprefix used below.
Capture and upload through the SDK
Inserver.cfg, start screenshot-basic before the SDK. Start any resource that calls the SDK after both.
takeServerImage to capture a specific player from server Lua, or takeImage to capture the local player from client Lua. Both exports upload through the SDK server resource and return object.publicUrl on success. See the SDK screenshot reference for complete examples and options.
Use a scoped URL with an existing upload flow
If your script already callsrequestScreenshotUpload, pass it a scoped upload URL. The short overload takes a URL, a multipart field name and a callback.
In your server script, call this function from a workflow that already authorizes the capture. Pass the server ID of the client that should take the screenshot.
file.
Verify uploads
Trigger one capture and check for the screenshot underscreenshots in the CDN object browser. Open the public URL from the result.
If the upload URL has expired or already accepted a file, request a fresh URL. If you change the screenshot encoding, also update the MIME allow-list to match.