Back
AuthorizedAuthorizedDocs
New

File Downloads

Upload files to your application and distribute them securely to licensed users. Only users with a valid API key for your application can download your files.

How it works

  1. Upload a file from your application's Files tab in the dashboard
  2. Copy the File ID shown next to the uploaded file
  3. Use the File ID in your client application to download the file at runtime
  4. To push an update, click the replace button (↻) — same ID, new content
  5. The file is streamed directly — no public URLs, no S3, no CDN needed

Download a File

GET/api/v1/files/:fileId
x-api-keyrequired
header
Your application API key
fileIdrequired
path
The file ID from the dashboard

Auto-Update Pattern

Because the file ID never changes when you replace a file, you can hardcode the ID in your application and push updates from the dashboard without touching your client code.

cpp
// Hardcode the file ID once — never changes even after you replace the file
const std::string UPDATE_FILE_ID = "abc-123-your-file-id";

// On launch, always download the latest version
Authorized.DownloadFile(UPDATE_FILE_ID, "C:\\MyApp\\update.exe");

Response

Returns the raw file bytes with appropriate Content-Type and Content-Disposition headers. On error returns JSON.

json
// Error response example
{
  "success": false,
  "message": "File not found"
}

Python

python
import requests

def download_file(api_key, file_id, save_path):
    response = requests.get(
        "https://authorized.lol/api/v1/files/" + file_id,
        headers={"x-api-key": api_key},
        stream=True
    )
    if response.status_code == 200:
        with open(save_path, "wb") as f:
            for chunk in response.iter_content(chunk_size=8192):
                f.write(chunk)
        print("Downloaded to " + save_path)
    else:
        print("Error:", response.json()["message"])

download_file("your_api_key", "abc-123-file-id", "C:/output/update.exe")

C++

cpp
// Download a file and save it to disk
// File ID is shown in the dashboard next to each uploaded file

Authorized.DownloadFile("abc-123-file-id", "C:\\path\\to\\save\\update.exe");

// The function returns true on success, false on failure
bool ok = Authorized.DownloadFile(file_id, destination_path);
if (!ok) {
    std::cerr << "Download failed" << std::endl;
}

C#

csharp
public static async Task DownloadFile(string apiKey, string fileId, string savePath)
{
    var request = new HttpRequestMessage(HttpMethod.Get,
        "https://authorized.lol/api/v1/files/" + fileId);
    request.Headers.Add("x-api-key", apiKey);

    var response = await client.SendAsync(request);
    if (response.IsSuccessStatusCode)
    {
        var bytes = await response.Content.ReadAsByteArrayAsync();
        await File.WriteAllBytesAsync(savePath, bytes);
    }
}

// Usage
await DownloadFile("your_api_key", "abc-123-file-id", @"C:\output\update.exe");
Warning:Files can be disabled from the dashboard at any time. Disabled files return a 403 error. Max file size is 50MB.

Dashboard

Manage files from your application's Files tab in the dashboard. You can upload, rename, enable/disable, and delete files. Each file shows its download count so you can track usage.