Open awahab3109 opened 7 months ago
As shown in the error message in the screenshot, you cant access "file://xxx" with XMLHTTPRequest. By default, XMLHttpRequest (XHR) is not allowed to access the file:// protocol for security reasons. This is due to browser policies and security restrictions.
maybe you can serve your demo with local server and access the files via the HTTP or HTTPS protocol.
As shown in the error message in the screenshot, you cant access "file://xxx" with XMLHTTPRequest. By default, XMLHttpRequest (XHR) is not allowed to access the file:// protocol for security reasons. This is due to browser policies and security restrictions.
maybe you can serve your demo with local server and access the files via the HTTP or HTTPS protocol.
thanks for the reply, but unfortunately your solution didn't work
I was using renderless.html as an example to get all the data in sections so that I can apply turn.js library on it. The problem i am facing regarding opening of the book is that when i use the url as specified in example, (https://s3.amazonaws.com/epubjs/books/moby-dick/OPS/package.opf), i get all the section data ,but when i changed it into my own url, it throws an error on book.spine.get(item) function. It shows CORS error, although i already have set the CORS Origin on my digital ocean , I also tried to set {contained:true} in my book constructor, but no result.
If it's really a cors error why am I unable to open it using file input too. Keep in mind, I am able a file i downloaded from google, but unable to open the one I built myself