Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the Blob of the inner file? #6

Open
microkof opened this issue Jul 9, 2015 · 1 comment
Open

How to get the Blob of the inner file? #6

microkof opened this issue Jul 9, 2015 · 1 comment

Comments

@microkof
Copy link

microkof commented Jul 9, 2015

After reading the readme.md, I don't understand how to get the Blob of the inner file yet.
Too ashamed.
Question 1: To need dataview-extra.js and reader.js or not?
Question 2: Please extend the following code, teach me how to get the Blob, thank you!!

var archive = RarArchive(file, function(err) {
if(err) {
return;
}
// Use archive
});

@matortheeternal
Copy link

I know I'm like almost a year late, but I'm just looking into this repository and I figured I'd address this issue for others's benefit.

Question 1: No.
Question 2: This function allows you to input a RAR archive File, an entry from that archive, and a callback function to call with the extracted file.

function getRarEntryFile(file, entry, callback) {
    RarArchive({type: RarArchive.OPEN_FILE, file: file}, function() {
        this.get(entry, function (error, blob) {
            if (blob) {
                callback(new File([blob], entry.name));
            } else {
                console.log('getRarEntryFile Error: ' + error);
            }
        });
    });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants