code: function (event) {
                  // Upload progress events are simpler. Begin building the progress
                  // event.
                  var progress = {
                      type: HttpEventType.UploadProgress,
                      loaded: event.loaded,
                  };
                  // If the total number of bytes being uploaded is available, include
                  // it.
                  if (event.lengthComputable) {
                      progress.total = event.total;
                  }
                  // Send the event.
                  observer.next(progress);
              }
docs: The upload progress event handler, which is only registered if progress events are enabled.