doc: updated PUT API
Massimo Melina committed
Mar 23, 2026 at 00:29 UTC
23e9da27cdbccd4ebad7dfd09e1af4baccf2e7f9
3 files changed
+47
-2
README.md
-1
@@ -125,7 +125,6 @@ If your language is missing, please consider [translating yourself](https://gith
125
- Append `?lang=CODE` to the URL to force a specific language
126
- `Right-click` on toggle-all checkbox to *invert* the state of all checkboxes
127
- Append `?login=USER:PASSWORD` to automatically log in to the browser
128
-- Append `?overwrite` when uploading to override the `dont_overwrite_uploading` configuration, provided you also have *delete* permission
128
- Append `?search=PATTERN` to trigger a search on startup
129
- Append `?onlyFiles` or `?onlyFolders` to limit the type of results
130
- Append `?get=basic` to display a basic web interface, intended for older/simpler browsers
frontend/src/uploadQueue.ts
+1
-1
@@ -130,7 +130,7 @@ export async function startUpload(toUpload: ToUpload, to: string, resume=0) {
130
return stopLooping = true
131
if (status === HTTP_PRECONDITION_FAILED) { // resume available
132
const size = Number(req.getResponseHeader('x-size'))
133
- if (req.getResponseHeader(MTIME_CHECK)) { // mtime check not available
133
+ if (req.getResponseHeader(MTIME_CHECK)) { // the only value for this header is not-available, so we fallback to the hash check
134
const hashFromServer = fetch(uriPath + '?get=' + UPLOAD_TEMP_HASH).then(r => r.text())
135
const hashed = await calcHash(toUpload.file, size) // therefore, we attempt a check using the hash
136
if (hashed !== await hashFromServer) {
openapi.yaml
+46
@@ -224,6 +224,52 @@ paths:
224
example: ''
225
schema:
226
type: string
227
+ - name: existing
228
+ in: query
229
+ description: >-
230
+ Conflict policy when the target file already exists. Use
231
+ `overwrite` to replace the file if the caller also has delete
232
+ permission, or `skip` to fail with conflict when the file exists.
233
+ required: false
234
+ schema:
235
+ type: string
236
+ enum:
237
+ - overwrite
238
+ - skip
239
+ - name: comment
240
+ in: query
241
+ description: Comment to store for the uploaded file
242
+ required: false
243
+ schema:
244
+ type: string
245
+ - name: mtime
246
+ in: query
247
+ description: Last modified time to apply to the uploaded file, in Unix milliseconds
248
+ required: false
249
+ schema:
250
+ type: number
251
+ - name: id
252
+ in: query
253
+ description: Client-generated upload identifier used to correlate retries
254
+ required: false
255
+ schema:
256
+ type: string
257
+ - name: resume
258
+ in: query
259
+ description: >-
260
+ Resume offset for resumable uploads. A trailing `!` asks the server
261
+ to reject the request when a better resume point is available.
262
+ required: false
263
+ schema:
264
+ type: string
265
+ - name: partial
266
+ in: query
267
+ description: >-
268
+ Remaining bytes still to be uploaded after this chunk. Used by split
269
+ and resumable uploads so the server can reserve enough disk space.
270
+ required: false
271
+ schema:
272
+ type: number
273
requestBody:
274
content:
275
application/octet-stream: