Skip to main content

Exports

Generates a pre-signed URL for uploading files.
local signedUrl = exports.nocloud:GenerateSignedUrl('image/png', 1024, {
    category = 'screenshots',
    owner = 'player123'
})
Parameters
  • mimeType: string - MIME type of the file (e.g., image/png, image/jpeg)
  • size: number - File size in bytes
  • metadata: table - Key-value pairs for custom metadata (optional)
Returns
  • signedUrl: string - Pre-signed URL for uploading
Uploads a file directly using base64 or raw data.
local result = exports.nocloud:UploadMedia(base64Data, {
    category = 'documents',
    owner = 'player123'
})

if result then
    print('File uploaded:', result.url)
    print('Media ID:', result.id)
end
Parameters
  • data: string - Base64 encoded file data
  • metadata: table - Key-value pairs for custom metadata (optional)
Returns
  • url: string - Public URL of the uploaded file
  • id: string - Unique media ID
Deletes a file from cloud storage.
local success = exports.nocloud:DeleteMedia(mediaId)

if success then
    print('File deleted successfully')
end
Parameters
  • mediaId: string - The media ID to delete
Returns
  • success: boolean - true if deletion was successful

Lua Library

For a cleaner API, include the server Lua library in your fxmanifest.lua:
server_script '@nocloud/lib/server.lua'
Usage
-- Generate signed URL
local signedUrl = Cloud.storage:generate_signed_url('image/png', 1024)

-- Upload file
local result = Cloud.storage:upload(base64Data, { category = 'files' })

-- Delete file
local success = Cloud.storage:delete_media(mediaId)