I am trying to figure out how to send a file and paramaters within the same XMLHttpRequest. Is this possible?
Obviously I can do xhr.send(file+params) or xhr.(file,params). And I don't think I can set two different request headers to do this...
xhr.setRequestHead('X_FILENAME', file.name)
xhr.send(file);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(params);
Is there some way to send the params without having to use GET, or a secondary xhr request?