Skip to main content
Use the FiveMesh SDK screenshot export to store qb-phone camera photos on FiveMesh CDN. The gallery receives the public URL through its existing server callback. This example follows the upstream qb-phone revision 333e813. If you run a fork, check that it uses the same camera callback and reads a JSON url field before applying the example.

Prerequisites

  • Set up FiveMesh CDN and install the FiveMesh SDK with an API key that has cdn:write.
  • Start screenshot-basic before fivemesh-sdk. Start qb-phone after both resources and qb-core.
  • If your API key has path restrictions, allow the qb-phone prefix.

Connect the camera

  1. In qb-phone/config.lua, set Config.Fivemerr = true. This upstream setting makes the camera use the server-side callback.
  2. In qb-phone/server.lua, find the existing qb-phone:server:UploadToFivemerr callback. Replace the entire callback registration with the example below. Keep its name so the camera can still call it.
  3. Save your changes and run restart qb-phone in the FiveM server console.
The callback uses the API key from the SDK’s server configuration.

Verify uploads

  1. Take a new photo in qb-phone and open it in the gallery.
  2. Check for the PNG under qb-phone in the CDN object browser and open its public URL.
  3. Take a second photo and confirm both entries still open.
If the gallery stays empty, check the FiveM server console for an SDK error. Confirm the capture and SDK resources started, the configured key has cdn:write, and the key allows the destination path and image/png.