Bug Tracker

Opened 8 years ago

Closed 5 years ago

#10190 closed feature (migrated)

"upload" property of the XMLHttpRequest

Reported by: superbulldeng@… Owned by:
Priority: high Milestone: 1.next/2.next
Component: ajax Version: 1.6.3
Keywords: 1.8-discuss Cc: jaubourg
Blocked by: Blocking:

Description (last modified by Rick Waldron)

There is a "upload" property in the xhr object returned by new XMLHttpRequest() in supported browser. But the object returned by $.ajax() seems didn't contain this property. This property is important to get the state of file upload progress.

Change History (17)

comment:1 Changed 8 years ago by addyosmani

Cc: jaubourg added
Component: unfiledajax
Priority: undecidedlow
Type: featureenhancement

comment:2 Changed 8 years ago by timmywil

Milestone: None1.next
Status: newopen

Marking as valid for 1.next

comment:3 Changed 8 years ago by malsup

Priority: lowhigh

This is really a fairly significant omission. As stated above, it's impossible to track FormData file upload progress without this property exposed. The jqXHR object is documented as a "superset of the browser's native XMLHttpRequest object". The upload property is but one example where this is simply not true, with respect to XMLHttpRequest Level 2. Either all properties should be exposed or there must be a way to access to the native XHR.

comment:4 Changed 8 years ago by ajpiano

Keywords: 1.8-discuss added

comment:5 Changed 8 years ago by jaubourg

Description: modified (diff)

-1, There are ways to access the native xhr (by overriding options.xhr in a prefilter). If we want upload in jQuery, then we'd better implement an upload method rather than try and have ajax be even more bloated.

comment:6 Changed 8 years ago by jzaefferer

+1, "overriding options.xhr in a prefilter" is not good enough - at least document how to access non-exposed properties in a sane way as part of the existing docs (see also Mike's comment)

comment:7 Changed 8 years ago by dmethvin

Description: modified (diff)

+1, I'd like a better/simpler way to do this as well

comment:8 Changed 8 years ago by mikesherov

Description: modified (diff)

+1

comment:9 Changed 8 years ago by timmywil

+1

comment:10 Changed 8 years ago by Rick Waldron

Description: modified (diff)

-1, Ajax is extendable.

comment:12 Changed 7 years ago by dmethvin

Type: enhancementfeature

Bulk change from enhancement to feature.

comment:13 Changed 7 years ago by timmywil

Keywords: needsdocs added

comment:14 Changed 7 years ago by mikesherov

Keywords: needsdocs removed

F you, Timmy

comment:15 Changed 6 years ago by meleyal

It seems you can access the xhr object in $.ajaxSettings.xhr();

comment:16 Changed 6 years ago by m_gol

Milestone: 1.next1.next/2.next

comment:17 Changed 6 years ago by dmethvin

I'm switching to -1 on this as far as $.ajax is concerned, since any addition we make here would not be cross-browser in either branch. I'd prefer to deal with this in $.xhr.

comment:18 Changed 5 years ago by m_gol

Resolution: migrated
Status: openclosed
Note: See TracTickets for help on using tickets.