You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If given this string value contains the file-upload mechanisms supported by the client.
410
-
The server **MAY** use this list to inform the contents of ``mechanisms`` in its response.
411
-
412
414
Servers **MAY** use the data provided in this request to do some sanity checking prior to allowing
413
415
the file to be uploaded. These checks may include, but are not limited to:
414
416
@@ -421,11 +423,13 @@ the file to be uploaded. These checks may include, but are not limited to:
421
423
If the server determines that upload should proceed, it will return a ``202 Accepted`` response, with
422
424
the response body below. The :ref:`status <session-status>` of the session will also include the filename in the ``files`` mapping. If the server determines the upload cannot proceed, it **MUST** return
423
425
a ``409 Conflict``. The server **MAY** allow parallel uploads of files, but is not required to.
426
+
If the server cannot proceed with an upload because the ``mechanism`` supplied by the client is not supported
427
+
it **MUST** return a ``422 Unprocessable Entity``.
424
428
425
-
.. _upload-session-response:
429
+
.. _file-upload-session-response:
426
430
427
-
Response Body
428
-
+++++++++++++
431
+
File Upload Session Response Body
432
+
+++++++++++++++++++++++++++++++++
429
433
430
434
The successful response includes the following JSON content:
431
435
@@ -436,10 +440,12 @@ The successful response includes the following JSON content:
436
440
"api-version": "2.0"
437
441
},
438
442
"links": {
443
+
"session": "...",
439
444
"file-upload-session": "..."
440
445
},
441
-
"upload-session-id": "<a string identifying the upload session>",
442
-
"mechanisms": {
446
+
"status": "pending",
447
+
"valid-for": 3600,
448
+
"mechanism": {
443
449
"http-post-application-octet-stream": {
444
450
"url": "..."
445
451
}
@@ -450,13 +456,32 @@ The successful response includes the following JSON content:
450
456
Besides the ``meta`` key, which has the same format as the request JSON, the success response has
451
457
the following keys:
452
458
453
-
``upload-session-id``
454
-
The unique file-upload session identifier.
459
+
``links``
460
+
A dictionary mapping :ref:`keys to URLs <file-upload-session-links>` related to this session,
461
+
the details of which are provided below.
455
462
456
-
``mechanisms``
457
-
A mapping containing the mechanism identifier that the server supports, to a mapping
458
-
containing details necessary to execute each mechanism.
463
+
``mechanism``
464
+
A mapping containing the supported mechanism identifier negotiated by the client and server,
465
+
to a mapping containing details necessary to execute the mechanism.
459
466
467
+
.. _file-upload-session-links:
468
+
469
+
Session Links
470
+
+++++++++++++
471
+
472
+
For the ``links`` key in the success JSON, the following sub-keys are valid:
473
+
474
+
``session``
475
+
The endpoint where actions for the parent session can be performed.
476
+
477
+
``file-upload-session``
478
+
The endpoint where actions for this file-upload-session can be performed.
479
+
including :ref:`canceling and discarding the file upload session <file-upload-session-cancelation>`,
480
+
:ref:`querying the current file upload session status <session-status>`,
481
+
and :ref:`requesting an extension of the file upload session lifetime <session-extension>`
482
+
(*if* the server supports it).
483
+
484
+
.. _file-upload-session-completion:
460
485
461
486
File Upload Session Completion
462
487
++++++++++++++++++++++++++++++
@@ -477,7 +502,14 @@ The JSON body of this requests looks like:
477
502
}
478
503
479
504
480
-
.. _cancel-an-upload:
505
+
After receiving this requests the server **MAY** perform additional asynchronous processing on the file,
506
+
for instance to verify its hashes or contents.
507
+
If the processing is required to complete before an upload session can be published,
508
+
the status of the file upload session can be set to ``processing`` until such processing is complete,
509
+
reaches an error state, or the file upload session is canceled.
510
+
511
+
512
+
.. _file-upload-session-cancelation:
481
513
482
514
Canceling and Deleting File Uploads
483
515
+++++++++++++++++++++++++++++++++++
@@ -499,7 +531,7 @@ To replace a session file, the file upload **MUST** have been previously complet
499
531
deleted. It is not possible to replace a file if the upload for that file is in-progress.
500
532
501
533
To replace a session file, clients should :ref:`cancel and delete the in-progress upload
502
-
<cancel-an-upload>` by issuing a ``DELETE`` to the upload resource URL for the file they want to
534
+
<file-upload-session-cancelation>` by issuing a ``DELETE`` to the upload resource URL for the file they want to
503
535
replace. After this, the new file upload can be initiated by beginning the entire :ref:`file upload
504
536
<file-uploads>` sequence over again. This means providing the metadata request again to retrieve a
505
537
new upload resource URL. Client **MUST NOT** assume that the previous upload resource URL can be
@@ -511,13 +543,16 @@ reused after deletion.
511
543
Session Status
512
544
~~~~~~~~~~~~~~
513
545
514
-
At any time, a client can query the status of the session by issuing a ``GET`` request to the
515
-
``session`` :ref:`link <session-links>` given in the :ref:`session creation response body
516
-
<session-response>`.
546
+
At any time, a client can query the status of a session by issuing a ``GET`` request to the
547
+
``session`` :ref:`link <session-links>` or ``file-upload-session`` :ref:`link <file-upload-session-links>`
548
+
given in the :ref:`session creation response body <session-response>`
549
+
or :ref:`file upload session creation response body <file-upload-session-response>`,
550
+
respectively.
517
551
518
-
The server will respond to this ``GET`` request with the same :ref:`response <session-response>`
519
-
that they got when they initially created the upload session, except with any changes to ``status``,
520
-
``valid-for``, or ``files`` reflected.
552
+
The server will respond to this ``GET`` request with the same :ref:`session response <session-response>`
553
+
or :ref:`file upload session creation response body <file-upload-session-response>`,
554
+
that they got when they initially created the upload session or file upload session,
555
+
except with any changes to ``status``, ``valid-for``, or ``files`` reflected.
521
556
522
557
523
558
.. _session-extension:
@@ -527,8 +562,9 @@ Session Extension
527
562
528
563
Servers **MAY** allow clients to extend sessions, but the overall lifetime and number of extensions
529
564
allowed is left to the server. To extend a session, a client issues a ``POST`` request to the
530
-
``session`` :ref:`link <session-links>` given in the :ref:`session creation response body
531
-
<session-response>`.
565
+
``session`` :ref:`link <session-links>` or ``file-upload-session`` :ref:`link <file-upload-session-links>`
566
+
given in the :ref:`session creation response body <session-response>`
567
+
or :ref:`file upload session creation response body <file-upload-session-response>`, respectively.
0 commit comments