Skip to content

Commit

Permalink
Explain why we're using XHR here (#30187)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg authored Nov 11, 2023
1 parent da5749d commit 39aed53
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,11 @@ Here is a live demo of the code above:

## Example: Uploading a user-selected file

Another thing you might want to do is let the user upload the selected file or files (such as the images selected using the previous example) to a server. This can be done asynchronously very easily.
This example shows how to let the user upload files (such as the images selected using the previous example) to a server.

> **Note:** It's usually preferable to make HTTP requests using the [Fetch API](/en-US/docs/Web/API/Fetch_API) instead of {{domxref("XMLHttpRequest")}}. However, in this case we want to show the user the upload progress, and this feature is still not supported by the Fetch API, so the example uses `XMLHttpRequest`.
>
> Work to track standardization of progress notifications using the Fetch API is at <https://github.com/whatwg/fetch/issues/607>.
### Creating the upload tasks

Expand Down

0 comments on commit 39aed53

Please sign in to comment.