Hi All,
I have a requirement to send a .tar file to IS flow service. i would like to check with you guys, is this possible with webMethods. Below is the code i wrote to send the .tar file to IS service.
dnd binary upload alert("hello"); function sendFile(file) { alert("hello1"); const uri = "http://host:port/invoke/TEST/reprocessFiles"; const xhr = new XMLHttpRequest(); const fd = new FormData(); xhr.open("POST", uri, true);
xhr.setRequestHeader("Content-Type", "application/octect-stream");
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
alert("INSIDE IF 200"+xhr.responseText); // handle response.
}
else{
alert(“ERROR IN CALLING SERVICE”);
}
};
fd.append(‘myFile’, file);
// Initiate a multipart/form-data upload
alert(“INSIDE APPEND FILE DATA”+fd);
xhr.send(fd);
}
window.onload = function() {
const dropzone = document.getElementById("dropzone");
dropzone.ondragover = dropzone.ondragenter = function(event) {
event.stopPropagation();
event.preventDefault();
}
dropzone.ondrop = function(event) {
alert(“helloo2”);
event.stopPropagation();
event.preventDefault();
const filesArray = event.dataTransfer.files;
alert("LENGTH"+filesArray.length);
for (let i=0; i<filesArray.length; i++) {
alert("FILE ARRAY"+filesArray[i]);
var reader = new FileReader();
sendFile(reader.readAsText(filesArray[i]));
}
}
}
</script>
Below are the queries i have.
- what is the content type i need to use to send this .tar file.
- In the flow service what is the input i need to define to receive this file and once i received the content how to extract the files from the .tar file.
Kindly throw some pointers to move forward on this subject.
Thanks & Regards,
Harish Babu.M