Tuesday 15 December 2015

Node.js readFileSync ZIP file

Hopefully someone can help! I've been asked to retrieve the contents of a ZIP file sitting on a server. I know the software uses eval() so I'm making use of this. I do not have access to the server so can't install modules.fs.readFileSync('/dir/file.zip','utf-8') When the output gets ptinted to the screen, it looks promising e.g.PK�coG���^�*fileinquestion.txtUT.......... However when I save the resulting text to notepad and save it as a ZIP file, I get the message that its corrupted or not a valid file.I know the ZIP file on the server is valid, but how to do I go about extracting it using the function or above, via the eval() function?

Submitted December 15, 2015 at 10:09AM by FestivalGeek

No comments:

Post a Comment