Simple file host for ShareX that abuses wildcard hostname for file code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3.9 KiB


Simple file host that puts the file code in the hostname. The leftmost part of the Host (i.e. 1234 of is used to serve a corresponding folder (i.e. files/1234/); if the folder contains one file then it is served directly, but if it contains multiple files then it is served as a webroot with a directory index. Designed for use as a ShareX Custom Uploader, but you can drop any lowercase alphanumeric folder into the files directory to serve it instantly.

You can also put the file code in the URL of the main domain. For example, and are the same. If there is no code in either the URL or subdomain, then the default code is www, which means and are the same, and you can put content in files/www for it (index.html etc).


Clone repository and install dependencies with npm ci.

The following environment variables are required for operation. You can put them in an .env file, which the program will load itself.

Variable Description
AUTH_TOKEN Unique confidential key to authenticate uploads

The following environment variables are optional.

Variable Description Default
HOSTNAME Overrides the hostname for generating URLs. hostname of the upload request
DISCORD_WEBHOOK Discord webhook url that newly-uploaded URLs will be sent to to pre-load their embed, which theoretically makes them embed again faster. undefined (disabled)
PORT TCP port to listen on 8568
ADDRESS Address to bind to '' (all)
FILES_DIR Directory to store the files in 'files' (relative of working directory)
TMP_DIR Directory to store pending uploads in os.tmpdir()
TRUST_PROXY Value for express's 'trust proxy' setting ''

Run with node qonq.js or your favorite init system.

ShareX config

  "Version": "12.4.1",
  "DestinationType": "ImageUploader, TextUploader, FileUploader",
  "RequestMethod": "POST",
  "RequestURL": "http://localhost:8568/upload",
  "Headers": {
    "authentication": "paste value of AUTH_TOKEN here"
  "Body": "MultipartFormData",
  "FileFormName": "file"

You can import this custom uploader config and modify the Request URL and authentication fields as necessary.

Nginx config example

server {
        server_name *;
        listen 443 ssl;
        ssl_certificate /etc/letsencrypt/live/;
        ssl_certificate_key /etc/letsencrypt/live/;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
        client_max_body_size 1G;
        location / {
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_pass http://localhost:8568;
server {
        server_name *;
        listen 80;
        return 308 https://$host$request_uri;

Command lines for Mac

There is no ShareX for Mac so here are some command lines you can use with iCanHazShortcut

# for fullscreen
SS=${TMPDIR}screenshot.png; screencapture -Cdt jpg $SS && URL=$(curl -H "Authentication: your_auth_token" -F "file=@$SS" && tr -d '\n' <<< $URL | pbcopy && osascript -e "display notification \"$URL\" with title \"Screenshot upload complete\"" && rm $SS

# for interactive
SS=${TMPDIR}screenshot.png; screencapture -idt png $SS && URL=$(curl -H "Authentication: your_auth_token" -F "file=@$SS" && tr -d '\n' <<< $URL | pbcopy && osascript -e "display notification \"$URL\" with title \"Screenshot upload complete\"" && rm $SS