diff options
| author | Julian Hurst <julian.hurst@digdash.com> | 2025-01-23 14:50:03 +0100 |
|---|---|---|
| committer | Julian Hurst <julian.hurst@digdash.com> | 2025-01-23 14:50:03 +0100 |
| commit | 0af48813e74af53cc0b9c93400a78c19e7aacb2f (patch) | |
| tree | 1f54f8f56c4d29e943c2f9f950a92af8715798f5 /templates | |
| parent | 79fde8d68f3366415cffd0da5022a3582438b468 (diff) | |
| download | box-0af48813e74af53cc0b9c93400a78c19e7aacb2f.tar.gz | |
X-Upload-Token -> X-Token and flesh out index.html
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.html | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/templates/index.html b/templates/index.html index 9264991..9a03510 100644 --- a/templates/index.html +++ b/templates/index.html @@ -37,16 +37,24 @@ } } xhr.open("POST", "/upload", true); - xhr.setRequestHeader("X-Upload-Token", token) + xhr.setRequestHeader("X-Token", token) xhr.send(f) } </script> </head> <body> - <h1>Box</h1> - <pre>Server for uploading files. Use the form here or send a POST request to /[filename] with the content of the file in the body.</pre> + <pre>Server for uploading files. + +Use the form here or send a POST request to /upload with the content of the file in the body. +If a token has been set on the server, pass the token in the request via a X-Token header. + +The response will contain a X-Resource-ID header containing the ID of the saved file. +This ID can then be used to get the file by sending a GET request to /[resourceID]. + +If enabled on the server, the resource can be deleted by sending a DELETE request to /[resourceID]. +Again if a token has been set on the server, use a X-Token header when sending the request.</pre> {{ if ne . "" }} - <input type="text" id="token"/> + <input type="text" id="token" placeholder="token"/> {{end}} <input type="file" id="file"/><br/><br/> <button type="button" onclick="upload()">Upload</button> |
