code: function() {
              var xhr = $.ajaxSettings.xhr();
              if (!xhr.upload) return xhr;
              xhr.upload.addEventListener('progress', function(e) {
                options.progress(e.loaded / e.total);
              });
              return xhr;
            }
docs: Send progress updates