1

I am converting docx to epub using pandoc. After converting epub, i do changes with zip file and converting epub also. At that time,

I got the following issue after converting zip file to epub on mimetype file.

 Mimetype contains wrong type (application/epub+zip expected).

I am searching a lot and get two logic

  1. First one e.g., extra spaces, new line characters but it was going vain(there is no extra spaces, new line).

  2. Add the mimetype file without compression in zip.

I am getting struck with second point. How to add mimetype file without compression in zip using node.js coding.

 var archiver = require('archiver');
 var archive = archiver('zip');
 archive.file('d:\\xxxx'+'\\mimetype', { name:'mimetype'});

What is the problem in the above code and any attribute for zip?

Can any one assist me for adding file without compression in zip?

Thanks in advance.

4
  • do it like this :archive.file('dir_location/filename.txt', { name:'filename.txt' }); Commented Jun 2, 2015 at 16:21
  • Same as : archive.file('d:\\xxxx'+'\\mimetype.,txt', { name:'mimetype.txt'}); Nothing different.. How to mention compress method in this above code? Commented Jun 3, 2015 at 5:45
  • can you print , console.log(d:\\xxxx'+'\\mimetype)?let me know that Commented Jun 3, 2015 at 7:00
  • @PPB: I got solution. thanks for your response. Commented Jun 3, 2015 at 8:03

1 Answer 1

3

add the zip option {store:true} for without compression https://www.npmjs.com/package/archiver#store-boolean

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.