Forráskód Böngészése

docs: Document XHRUpload `timeout` property.

Renée Kooi 7 éve
szülő
commit
6a44d05b5f
1 módosított fájl, 9 hozzáadás és 0 törlés
  1. 9 0
      website/src/docs/xhrupload.md

+ 9 - 0
website/src/docs/xhrupload.md

@@ -100,4 +100,13 @@ getResponseError (xhr) {
 
 
 The field name containing a publically accessible location of the uploaded file in the response data returned by `getResponseData(xhr)`.
 The field name containing a publically accessible location of the uploaded file in the response data returned by `getResponseData(xhr)`.
 
 
+### `timeout: 30 * 1000`
+
+When no upload progress events have been received for this amount of milliseconds, assume the connection has an issue and abort the upload.
+Note that unlike the [`XMLHttpRequest.timeout`][XHR.timeout] property, this is a timer between progress events: the total upload can take longer than this value.
+Set to `0` to disable this check.
+
+The default is 30 seconds.
+
 [FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData
 [FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData
+[XHR.timeout]: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout