Upload a File
Beacon uploads files using the PUT /servers/{serverId}/files/{path} endpoint. The file’s contents will be the body of the request. Although the server can reply with the updated content and a 200 status, Beacon will ignore the content of the response. For this reason, the recommended response is a 204 status.
Security Notice
To prevent abuse, consider whitelisting file names. Although Beacon does not allow the uploading of arbitrary files, a malicious user could access your API directly to upload files. This could be problematic, especially if they choose to overwrite existing files.
Request Path Rules
- Paths must always use url-style forward slashes (
/) not backward slashes (\). - Paths containing
../will be rejected. ./and//will be replaced with/.- Leading and trailing slashes will be removed.
- Do not encode the path components. Example: use
Ark: Survival Ascended/ShooterGame/Saved/Config/WindowsServer/Game.ininotArk%3A%20Survival%20Ascended/ShooterGame/Saved/Config/WindowsServer/Game.ini.
Content Verification Headers
Content verification is optional but is strongly recommended for uploading and downloading files.
Every request that Beacon makes will include a Want-Content-Digest header. Currently, the value of this header is sha-512=10,sha-256=9,md5=0,sha=0,unixsum=0,unixcksum=0,adler=0,crc32c=0 but check the actual header in case the value changes. For brevity, most example requests in this documentation omit this header.
If the server includes a Content-Digest response header with a compatible hash, Beacon will verify the response body and retry the request if the hash does not match. Beacon will attempt two retries (for a total of three attempts) before displaying an error to the user.
All Beacon requests that include a body also include a Content-Digest request header. At the time of this writing, Beacon requests contain both SHA-512 and SHA-256 hashes. If it cannot verify the request, the server should reply with a 406 status.
Example Exchange
Request
PUT /servers/bebb2aae-99bb-41be-b928-5374d6dabc61/files/Game.ini HTTP/1.1
Authorization: KEY secretToken
Host: api.example.com
Content-Type: application/octet-stream
Want-Content-Digest: sha-512=10,sha-256=9,md5=0,sha=0,unixsum=0,unixcksum=0,adler=0,crc32c=0
Content-Digest: sha-512=:uBJBUBqFLk4jFu4qW1WVA4FRubafx1gnZEHDCEmaNyt+JJwrAyJX5l1mKIcFQKXijnkteHJy8FJGy1xjaWteAQ==:,sha-256:VNmcFTIvjmomrm2jQLlx1rRqGmgmWloR3b8/fHCzy58=:
[/script/shootergame.shootergamemode]
bUseSingleplayerSettings=False
Response
HTTP/1.1 204 No Content