Add a place for egroupware to tap into file request before it's sent

This commit is contained in:
Nathan Gray 2011-09-08 20:32:58 +00:00
parent 57dc999881
commit 6585ff14e6

View File

@ -141,6 +141,7 @@
if (window.FormData) {//Many thanks to scottt.tw
var f = new FormData();
f.append(typeof(options.fieldName) == "function" ? options.fieldName() : options.fieldName, file);
if(typeof(options.beforeSend) == "function") { options.beforeSend(f);} // Give eGW a chance to interfere
xhr.send(f);
}
else if (file.getAsBinary) {//Thanks to jm.schelcher
@ -171,6 +172,16 @@
builder += file.getAsBinary();
builder += crlf;
// Give eGW a chance to interfere
if(typeof(options.beforeSend) == "function") {
builder += dashdash;
builder += boundary;
builder += crlf;
builder+=options.beforeSend();
builder += crlf;
}
/* Write boundary. */
builder += dashdash;
builder += boundary;