epubjs-reader icon indicating copy to clipboard operation
epubjs-reader copied to clipboard

META-INF/container.xml error while serving epub file as web api

Open purusingh opened this issue 6 years ago • 11 comments

When I send the file using static file path it works but if I serve file as res.sendFile(..) it is not working and not even hitting this api?

I am getting META-INF/container.xml is not found error?

What do I have to do in order to make it work.

Thank You

purusingh avatar Sep 24 '18 13:09 purusingh

Hey fixed it by adding /file.epub at the end of the url. Looks pretty wacko. I was doing /download/<id> now I have to do download/<id>/file.epub

jdupl avatar Oct 31 '18 02:10 jdupl

@jdupl Thank you so much!!! I have refactored and changed the code for the past 2 hours just to find out that all that was missing is the .epub suffix at the end of the api route...

AndreevskiAleksandar avatar Nov 21 '18 16:11 AndreevskiAleksandar

@jdupl For me, it is angular-epub-viewer which reads the CDN presigned URL. But the above solution worked. ( During uploading, I forgot to add extension".epub" in the file name. )

mananshah88 avatar Jan 14 '20 06:01 mananshah88

@jdupl How did you go about solving this issue ? the URL which i am passing is a blob url that has a token parameter. it is giving me the same error : image

dhiv-nitt avatar Mar 19 '20 08:03 dhiv-nitt

help

acoolstraw avatar Jan 16 '22 06:01 acoolstraw

help

Troplo avatar Jan 16 '22 06:01 Troplo

help

acoolstraw avatar Jan 16 '22 06:01 acoolstraw

help

Troplo avatar Feb 25 '22 07:02 Troplo

help

acoolstraw avatar Feb 25 '22 07:02 acoolstraw

please, I am unable to live without this project

Troplo avatar May 20 '22 03:05 Troplo

please, I am unable to live without this project

acoolstraw avatar May 20 '22 03:05 acoolstraw

It's part of standard defined here: https://www.w3.org/publishing/epub3/epub-ocf.html#sec-container-metainf-container.xml

saadjutt01 avatar Jun 28 '22 17:06 saadjutt01

I was having this issue in this project, but Google brought me here.

I was debugging this, the issue is the Zip was created having the ZipEntry in Windows: META-INF\container.xml

But unfortunately, this check is not passing: https://github.com/w3c/epubcheck/blob/58a61935a8fdd2875539be58dc6bc1ed87615740/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java#L116

This is because the value of that constant contains this path: META-INF/container.xml https://github.com/w3c/epubcheck/blob/58a61935a8fdd2875539be58dc6bc1ed87615740/src/main/java/com/adobe/epubcheck/ocf/OCFData.java#L9

It is failing to pass that check, even having the file inside the ZIP, because of that.

I have created an issue here: https://github.com/w3c/epubcheck/issues/1357

jbescos avatar Nov 03 '22 19:11 jbescos