change extension to upload message via xmlhttprequest
This commit is contained in:
parent
1589c2c092
commit
d931bebecd
|
@ -89,6 +89,30 @@ function(droppedItem) {
|
|||
url[i++] = "&filename=ZimbraItems";
|
||||
|
||||
var getUrl = url.join("");
|
||||
|
||||
var oReq = new XMLHttpRequest();
|
||||
oReq.open("GET", getUrl, true);
|
||||
oReq.responseType = "blob";
|
||||
|
||||
oReq.onload = function(oEvent) {
|
||||
var blob = oReq.response;
|
||||
/* needs Access-Control-Allow-Origin: * header on the server */
|
||||
var postUrl = 'http://test.ged.pfwb.be/@@importZimbra';
|
||||
|
||||
var sendReq = new XMLHttpRequest();
|
||||
sendReq.open("PUT", postUrl, true);
|
||||
sendReq.onload = function (oEvent) {
|
||||
// Uploaded.
|
||||
alert('done');
|
||||
};
|
||||
|
||||
sendReq.send(blob);
|
||||
};
|
||||
|
||||
oReq.send();
|
||||
|
||||
|
||||
|
||||
window.open(getUrl, "_blank");
|
||||
};
|
||||
|
||||
|
@ -96,4 +120,4 @@ EmailDownloaderZimlet.prototype._getMsgIdsFromConv =
|
|||
function(convSrcObj) {
|
||||
convSrcObj.load();
|
||||
return convSrcObj.msgIds;
|
||||
};
|
||||
};
|
||||
|
|
Reference in New Issue