Skip to content

A lightweight file server for FiveM using CFX HTTP wrapper

License

Notifications You must be signed in to change notification settings

nonefivem/cfx-file-server

Repository files navigation

NoneM Logo

no-file-server

A lightweight file server for FiveM using CFX HTTP wrapper

TypeScript Bun FiveM


About

no-file-server is a simple HTTP file upload server designed for FiveM. It allows your server-side scripts to upload, store, and serve files (images, audio, video, PDFs) locally without relying on external services.

Runs on FiveM's Node.js runtime via @citizenfx/http-wrapper.

Features

  • 📁 File Uploads - Upload images, audio, video, and documents
  • 🔗 File Serving - Access uploaded files via HTTP
  • 🛡️ Rate Limiting - Configurable per-IP request limits
  • 🔒 Player IP Check - Restrict access to connected players only
  • ⚙️ Configurable - Max file size, allowed mime types, directories
  • 🚀 Lightweight - Minimal dependencies, fast builds

Installation

  1. Download the latest release from Releases
  2. Extract to your FiveM resources folder
  3. Add ensure no-file-server to your server.cfg
  4. Configure config.json as needed

Configuration

Edit config.json to customize:

Option Description Default
security.trustedOrigins Allowed CORS origins ["*"]
security.isPlayerCheck Only allow connected player IPs true
rateLimit.enabled Enable rate limiting true
rateLimit.maxRequests Max requests per time window 10
rateLimit.windowMs Time window in milliseconds 60000 (1 minute)
uploads.directory Upload folder path ./uploads
uploads.maxFileSizeMB Max file size in MB 10
uploads.allowedMimeTypes Allowed file types Images, audio, video

API Endpoints

Endpoints are available at:

https://<cfx-username>-<server-id>.users.cfx.re/no-file-server/uploads
Method Endpoint Description
POST /uploads Upload a file (multipart form, field: file)
GET /uploads/:filename Get/serve a file

Example

POST https://<cfx-username>-<server-id>.users.cfx.re/no-file-server/uploads
GET  https://<cfx-username>-<server-id>.users.cfx.re/no-file-server/uploads/screenshot_1234567890_abc123.jpg

License

MIT

About

A lightweight file server for FiveM using CFX HTTP wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published