Open purusingh opened 6 years ago
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 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...
@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. )
@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 :
please, I am unable to live without this project
It's part of standard defined here: https://www.w3.org/publishing/epub3/epub-ocf.html#sec-container-metainf-container.xml
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
I have a solution for this
When you Loading ePub from a blob URL, then you should do the following things
async result => {
var byteArray = new Uint8Array(result['byteArray']);
var blob = new Blob([byteArray], { type: 'application/epub+zip' });
//This is an important
const objectUrl = await blob.arrayBuffer();
//This method is of epub
readFile(objectUrl);
}
Hi all,
I use this setup in React Native and it works, thanks to you all,
https://mydomain.com/staticfolder/${accessToken}/${id}.epub
So when the epub reader get the epub file on my nodejs server, I authenticate it using the accessToken via an authentication middleware in nodejs.
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