Skip to content

Allow specifying an xhr.upload.onProgress event listener in convenience functions for HttpRequest #19242

Open
@DartBot

Description

This issue was originally filed by jirkadanek...@gmail.com


What steps will clearly show the issue / need for enhancement?

I have a file which I want to upload to a server. During the upload, I want to update a progressbar for the user.

What is the current output?

I need to resort to using an instance of HttpRequest directly, because neither HttpRequest.sendFormData nor HttpRequest.request allow me to register a listener for HttpRequest.upload.onProgress.

What would you like to see instead?

I suggest adding an onUploadProgress parameter to functions sendFormData and request. Then, the library could do something like

  if (onUploadProgress != null) {
    xhr.upload.onProgress.listen(onUploadProgress);
  }

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-webUse area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.library-htmltype-enhancementA request for a change that isn't a bugweb-librariesIssues impacting dart:html, etc., libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions