I made a simple script to send some user data to my servlet. The user data is taken from a form and marshalled into an xml document and then sent to the servlet, now I want to also take a file (image) and send it with the xml document, is there a way to do it without making another servlet that stores file and using another .post ?
Here is my code so far:
$.post( "../Profile", updateData,
function( data ){
//This is the success function
var xmlDoc = data;
var xmlString = (new XMLSerializer()).serializeToString(xmlDoc);
console.log("log. Data: " + xmlString);
location.reload(); //ricarica la pagina a profilo aggiornato
}
);
any suggestion about what to do are well appreciated, thanks everybody.
No comments:
Post a Comment