I want to have a code where I can unzip a zipped file but even after trying so many things, I am not able to do this.
I want this in my front end because I just want to unzip and process the file inside to do some computation with the data inside.
I tried
https://github.com/nika-begiashvili/libarchivejs
I followed this readme but still i got this error,
https://github.com/nika-begiashvili/libarchivejs#readme
but when I try to unzip the file I get this error
Looking at it, it looks like this error is that it is not able to decompress
i checked another popular solution in StackOverflow this is:
first answer of this:
Unzipping files
but I don't know what is
ZipFile in
var zipFile = new ZipFile(url, doneReading)
How can I get it !!
I am so lost, can anyone please help me !!
This is the zip file that I want to compress !!
This is inside my main zip file:
Related
I'm using this code to hash a single file:
const fs = require('fs');
let result = digest(fs.readFileSync('/users/ispedro/desktop/Test.PDF'));
console.log('Huella Digital MD5: ' + result)
I am trying to achieve the same but of all the files included in a folder, so that the output would be something like this:
The file (name of the file) generates the following MD5 hash: 175GKG3K6UZ6GAEE64BFKUN0MR
I have tried with various codes but have not succeeded ... any ideas please?
Update:
What I want to do is that the script reads the contents of a folder on the desktop without having to compress it in zip, so that I can remove or put files and when executing the script it returns the MD5 hash of those that are currently inside. I have tried to copy part of the code from this link npmjs.com/package/folder-hash which I think does exactly that but I can't get the script to work ...
Thank you very much to all.
I am decompiling a apk.
After the progress , I get the source code of the apk.
However , I found the apk's key file such as html's file or js's file are still encrypt.
Like this
What's the meaning of this picture?
Is't the hexadecimal?
But I found I can't transfer it with hexadecimal.
How can I get the source code of the api.js file?
Thank you.
The picture is the content of the file.
Yeah, it is hexadecimal.
You cannot look in api.js files without the decryption key.
I need to know if there is a way to retrieve the real file extension without parse the filename.
In my code I split the file using the function split(filename, ".") then i get the last element of the array that the function returns.
Now, if I create a .pdf file called, for example test_file.pdf, the previous method works perfectly, but if i rename my file to test_file(without extension) I cannot retrieve the extension even if I know that the file is a PDF.
For example, if i rename test_file.pdf to text_file.jpg how can I recognize that the file is still a pdf and not an image file with .jpg extension?
I would like to know if there is a way to obtain this information, maybe using file metadata or other information related to the file.
I'm looking for a Javascript solution because I have to check the extension when I upload the file using a form (client side) but even a Java solution could be fine, can you help me?
Thank you in advance!
Look at this post and the marked answer: Get real file extension -Java code
I guess it's just what you need.
The way I have it right now is that I use JavaScript to read a file, providing a hard coded path. I tell it to look it /public. I'm going to generate a file in the tmp directory with Rails, and I want to read it with JavaScript. How can I do this? What is the tmp directory of Rails?
I've tried putting the file into /tmp and hard coding JavaScript to read from /tmp, but it doesn't load the file.
I might be wrong but I think browser can access only files inside public folder unless it goes through Rails route. So, you can either change the location of tmp folder or you can create a method in a controller that will read that JS file and send it back to browser (sort of like proxy).
is there a library to unRAR files? The rar files I have to work with contain multiple files.
I'm looking for a way to navigate rar content, and get a blob with the uncompressed content of a selected file within the .rar one.
I'm already using zip.js to unzip files, and need the same for RAR. Thanks a lot for your time reading it.
I know this is an old question. But bitjs is no longer maintained, and very hard to use.
Try https://github.com/workhorsy/uncompress.js . It even works with RAR 5.
Here is the most trivial example I could make: http://workhorsy.github.io/uncompress.js/examples/trivial/index.html .