diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2013-07-03 10:02:20 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2013-07-03 10:03:19 +0200 |
commit | 440b58b476e723053d24e3e39803b64bc7fec115 (patch) | |
tree | 1117db561cf56bc17ff11cd2968f3e7f2dbb1309 /program/js | |
parent | c78a652746fde91ec6c713cdbaf368437d63e2e3 (diff) |
Fix binary data upload with jQuery.ajax()
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js index e7b73cdf4..b949570f5 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -6496,7 +6496,7 @@ function rcube_webmail() timeout: 0, // disable default timeout set in ajaxSetup() data: formdata || multipart, headers: {'X-Roundcube-Request': ref.env.request_token}, - beforeSend: function(xhr, s) { if (!formdata && xhr.sendAsBinary) xhr.send = xhr.sendAsBinary; }, + xhr: function() { var xhr = jQuery.ajaxSettings.xhr(); if (!formdata && xhr.sendAsBinary) xhr.send = xhr.sendAsBinary; return xhr; }, success: function(data){ ref.http_response(data); }, error: function(o, status, err) { ref.http_error(o, status, err, null, 'attachment'); } }); @@ -6536,7 +6536,7 @@ function rcube_webmail() multipart += '; filename="' + (f.name_bin || file.name) + '"' + crlf; multipart += 'Content-Length: ' + file.size + crlf; multipart += 'Content-Type: ' + file.type + crlf + crlf; - multipart += e.target.result + crlf; + multipart += reader.result + crlf; multipart += dashdash + boundary + crlf; if (j == last) // we're done, submit the data |