Closed cristian-sima closed 6 years ago
Hi. I use HTML5 form to upload a tar, untar it in order to get an XML file and then upload the XML file to the server.
This is the code
const problemWithTheFile = "Something went wrong", [myArchieve] = files, reader = new FileReader(); // Closure to capture the file information. reader.onload = (((theFile) => (event) => { untar(event.target.result).then( (extractedFiles) => { const [xmlFile] = extractedFiles; console.log("xmlFile.readAsString()", xmlFile.readAsString()); // ... then I can use the XML file }, () => { alert(problemWithTheFile); } ); })(myArchieve)); reader.readAsArrayBuffer(myArchieve);
When I look at console I see this:
I can not upload the archive, but it contains a single XML file and it works when trying to use with other programs.
@Qvazar Any idea on this? I would really appreciate if you can help me.
Thanks
Are you openning a tar.gz file instead of a tar file?
tar.gz
tar
Is there a way to handle tar.gz files as well?
Hi. I use HTML5 form to upload a tar, untar it in order to get an XML file and then upload the XML file to the server.
This is the code
When I look at console I see this:
I can not upload the archive, but it contains a single XML file and it works when trying to use with other programs.
@Qvazar Any idea on this? I would really appreciate if you can help me.
Thanks