OnUploadProgress - Typescript Client

Reading the documentation here: http://docs.servicestack.net/csharp-client#upload-and-download-progress-on-async-apis

I’m not seeing this method in the TypeScript implementation of the JSON client. Is this something new in 5.4.1 perhaps? I saw some other changes between the 5.4 and 5.4.1 typescript stuff from the .NET side of things (for example enums are no longer emitted as enums in typescript, but as “type” object)?

Anyway, the skinny is this: I’m uploading a file from typescript as part of a SS POST. I’d like to be able to get a sense of upload progress for the user. I’m currently using a base64 encoded string as part of the DTO.

Progress APIs is not available on the TypeScript client which uses W3C’s fetch() API to send Ajax requests which doesn’t support progress events.

You wouldn’t be able to use the TypeScript JsonServiceClient for this but it looks like progress events are available if you use the XMLHttpRequest API directly.

1 Like