How to get File upload progress with fetch() and WhatWG streams

后端 未结 2 1019
粉色の甜心
粉色の甜心 2021-02-19 09:17

Note: I\'m not looking for any alternatives. I know this can be done with XMLHttpRequest. I also don\'t care about browser support. I just want learn about the new/upcoming

2条回答
  •  一个人的身影
    2021-02-19 09:55

    Short answer: cannot be done right now.

    Checkout the spec here: https://fetch.spec.whatwg.org/#fetch-api

    Second sentence indicates that there isn't a way to track request progression when using fetch.

    The fetch() method is relatively low-level API for fetching resources. It covers slightly more ground than XMLHttpRequest, although it is currently lacking when it comes to request progression (not response progression).

提交回复
热议问题