Image hosting

Use with FiveM

Most FiveM resources that upload screenshots ask for three things: an upload address, a form field name, and where to find the link in the answer. This page gives you those.

The settings #

What the resource asks for What to enter
Upload URL https://eruptedhosting.com/api/v1/images
Form field name Any name works. file is a common choice
Header Authorization with your API key as its value
Where the link is in the answer url

Example: screenshot-basic #

A client script that takes a screenshot and uploads it, using the screenshot-basic resource:

exports['screenshot-basic']:requestScreenshotUpload(
    'https://eruptedhosting.com/api/v1/images',
    'file',
    { headers = { Authorization = 'YOUR_KEY' }, encoding = 'webp' },
    function(data)
        local answer = json.decode(data)
        if answer and answer.url then
            print('Uploaded: ' .. answer.url)
        else
            print('Upload failed: ' .. tostring(data))
        end
    end
)

Note

This follows screenshot-basic's documented options. Resources differ between versions, so check the one you use sends custom headers, and adjust the names if it does not.

Keep your key off the players' computers #

Client scripts run on each player's computer, so a key written into one can be read by players.

  • Keep the key in a server script or a server convar, and hand it to the client only at the moment it is needed.
  • Use a key made only for this server, so you can revoke it without touching anything else.
  • Watch Last used and your storage on the Image hosting page. If uploads appear that are not yours, revoke the key and create a new one.

Warning

Whoever has a key can upload to your storage and delete your images. They cannot reach anything else on your account.

It is not working #

What you see Likely cause
401 The key is wrong or revoked, or the header is not being sent
400 The resource sent something that is not a PNG, JPEG, WebP or GIF image
413 The image is over the size limit, or your storage is full
Nothing at all The resource may not allow this address. Check its own settings and the server console