-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload progress? #21
Comments
The native |
But yet, it does not mean it couldn't be pondered and proposed. Native promises are not yet cancellable and/or progressed, so my proposal would be for a callback on the second argument object of As a polyfill, it could be easily placed with the API Example: aync fetchSometing ( form ) {
const res = await fetch('/upload', {
method: 'POST',
body: form,
progress: (e) => { console.log(`Progress: ${e.loaded/e.total}%`) }
})
} |
So why @cusspvz's idea doesn't seem to have been taken in consideration ? |
Discussion around fetch observation is over at #447. |
The discussion in #447 was more about fetch cancellation, now it's added in the spec with AbortController For fetch upload progress, it would be great, that's the only missing thing compared to XHR |
Ah, thanks for pinging this thread. Observation moved to #607. Hope that helps. |
Please reopen this issue. This is real world scenario on millions of websites daily. Fetch needs needs an upload progress. period. We've been stuck with the bad XHR API for decades now. Yet, no one seems concerned that despite all the efforts and years of debates that went into fetch it does not deliver. Can everyone on this committee stop treating it as a hot potato a deal with it. |
There is no committee… And this issue is closed because there is a more focused issue around a concrete proposal towards addressing this. |
@oliverjanik Use the |
No thanks, I like my batteries included. |
It can be done if browsers will start support ReadableStream for Request object's body. Currently there is only support of ReadableStream for Response object's body and you can use it for checking download progress. They should implement that: Check your browser: So, waiting for the browser support, in this case you even do not need something like this: #607 See also: #425 |
# This is the 1st commit message: # This is a combination of 23 commits. # This is the 1st commit message: Integrate CORP and COEP This is part of the introduction of COEP (whatwg/html#5454). The CORP check now takes COEP into account. Also, responses coming from service workers are checked. # This is the commit message #2: Update fetch.bs Co-authored-by: Domenic Denicola <d@domenic.me> # This is the commit message #3: Update fetch.bs Co-authored-by: Domenic Denicola <d@domenic.me> # This is the commit message #4: fix # This is the commit message #5: fix # This is the commit message #6: fix # This is the commit message #7: fix # This is the commit message #8: fix # This is the commit message #9: fix # This is the commit message #10: fix # This is the commit message #11: fix # This is the commit message #12: fix # This is the commit message #13: fix # This is the commit message #14: fix # This is the commit message #15: fix # This is the commit message #16: fix # This is the commit message #17: fix # This is the commit message #18: Update fetch.bs Co-authored-by: Anne van Kesteren <annevk@annevk.nl> # This is the commit message #19: Update fetch.bs Co-authored-by: Anne van Kesteren <annevk@annevk.nl> # This is the commit message #20: fix # This is the commit message #21: fix # This is the commit message #22: fix # This is the commit message #23: fix # This is the commit message #2: fix
Is there any way I can attach a progress listener to the xhr.upload object used in fetch?
since I use fetch to upload files (with FormData), I would find this very useful.
I initially reported this at JakeChampion/fetch#89, and was suggested to have it reported here
The text was updated successfully, but these errors were encountered: