Skip to content

Instantly share code, notes, and snippets.

View RyhazL's full-sized avatar

Zahyr Lanz RyhazL

  • Brazil, Curitiba
View GitHub Profile
@adinan-cenci
adinan-cenci / _fetch-form.md
Last active May 9, 2024 22:33
How to follow upload progress with fetch()

How can we follow the upload progress with fetch() ?

Simple: We can't.
Not right now anyway, fetch() does not support that, but good old XMLHttpRequest does though.

The function below behaves much like fetch(), it will return a Promise that will resolve into a Response object.

Just pass a progress function in the options parameter.