How to open epubs in Chrome by link - google-chrome

I have a https:// (The server is a webdav server on IIS) link to an epub. Now I would like to open it in Chrome with the ePUB Reader Extention automatically by clicking on it. It works fine for PDFs but not for epubs. I do get an ERROR 404. But wenn I download the link with carotdav, I can get the epub file. SO THE LINK is valid.
Edit: IF I RENAME the file to Extention .RAR it I can download it with wget. But with Extention EPUB or EPU I also can not download it with wget.
How to proceed?
Thanks

I found the solution. in IIS on WINDOWS 10 Server there was the MIME-type missing. I had to define in MIMETYPEs the .epub as application/epub+zip. Now I can download and use the ePub Reader for Chrome Here_to_download to open the ePub in Chrome.

Related

When I try to open .html file in chrome it ocassionally open repository

it divide my html file on 2 different files 1)is repository 2)is just some loading page
same error with pdf files but it divides on 3 files
It works in Firefox.
Google Chrome is set to be my main browser.
Maybe the version of chrome that you use don't support what you're doing but its just my random guess , you can try to use live server of some IDE like VScode and see if the problem persist.

Downloading a file directly via a Link in HTML/Android-Studio

I'm trying to download a file from a link in an HTML file in an Android Studio
Scenario:
Press on "Download" to download an APK file:
Download
I tried with opening google or other pages - it works.
And yes, my link is correct :D

How do I host an mhtml file on a webserver?

I want to just be able to get people to go a link to an mhtml file hosted on a server and be able to see the fully formatted webpage that you'll see when you save the file and open it in Google Chrome (Apparently IE works as well, Firefox and Microsoft Edge do not work). How do I go about doing that?
Might as well post this as an answer for whomever else gets this problem.
Upon renaming the mhtml file to an mht file, and Extractmht can be used to convert the file to an html file, which can then be hosted.
[2022 Edit]:
Alternatively, open the mhtml file in Chrome/Firefox and use an extension like Singlefile to download it as a proper html page.

View local html file with .asp extension in browser

Hi I have crawled a website for offline view, but many pages are downloaded and saved as .asp and there are links that point to these pages. But when I open these html page that has .asp extension in Chrome browser, the chrome will download the page instead of rendering the page. Is there a way to set the chrome to render the page instead of downloading it ?
Thanks
Chromium uses the system mime-type for the local files. On Linux you can change it in the xdg-open configuration:
$ mkdir -p ~/.local/share/mime/packages
$ cd ~/.local/share/mime/packages
$ touch application-x-asp.xml
Then edit the ~/.local/share/mime/packages/application-x-asp.xml:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/html">
<comment>Active Server Page</comment>
<icon name="text-html"/>
<glob-deleteall/>
<glob pattern="*.asp"/>
</mime-type>
</mime-info>
to set up the mime-type to text/html. On te end you have to logout/-in again, or just run:
$ update-desktop-database ~/.local/share/applications
$ update-mime-database ~/.local/share/mime
When your browser opens a file it uses the MIME type to decide which action it should take, typically download or open in the bowser.
So, for example, it encounters a zip file it will open the file save dialogue box and allow you to save the file.
And, if for example, you request a .asp from your browser which is served from a web server the browser will use the MIME type to decide which action to take, which will be to display in the browser.
The MIME type will be sent within the http headers and this would not be sent to the browser when you open your off-line .asp pages.
So if you could change the MIME type to "text/html" for .asp it should open it in the browser.
Unfortunately, there does not seem to be an option for changing MIME type / actions in Chrome.
You can change these setting in Firefox within Tools > Options > Content > FileTypes > Manage..
There is a way to open local, .asp files as HTML in Firefox.
Find your Firefox profile folder. On Windows 7, I found it here:
C:\Users\user\AppData\Roaming\Mozilla\Firefox\Profiles\738xdie.default\mimeTypes.rdf
Then add these lines to mimeTypes.rdf
<RDF:Description RDF:about="urn:mimetype:text/html"
NC:fileExtensions="asp"
NC:description="ASP Pages"
NC:value="text/html"
NC:editable="true">
</RDF:Description>
Restart browser. Your local file will now render as HTML.
There may be a similar technique with Chrome.
I suppose you want to view downloaded pages directly, that is not via some local web-server. Then I'd suggest to change (or append) file extensions during download according to their reported content-types from response headers. Of course, this will require to adjust all links to changed filenames inside other files. The other approach could be to store content-type of each page in a meta-base, and using a local web-server to serve the files according to their actual types from the base, not file extensions.
I have two solutions for you. the first one is to open those files with firefox.. and that's it..
if you insist to open them with chrome. you have to change all files extension to html instead of asp. use some programs for renaming..
but the links will be broken between pages..
so you have to find the js file that all pages use add this code in it to fix the links
document.body.addEventListener('click',function(e){
if(e.target.nodeName=='A'){
e.preventDefault()
href=e.target.href.split('/')
href[href.length-1]=href[href.length-1].replace('.asp','.html')
href=href.join('/')
parent.location=href
}
})
})

IE 7 and 8 SSL download from simple HTML page not working, tomcat server

I have a simple HTML file which has one link to a file kept for download. The site uses SSL (self signed cert). When I click on the file to be downloaded in FF or Chrome, it works fine and saves the file on to disk.
Here is the code-
<html><body> download from here</body></html>
When I open the same page with IE 7/8, and click on the link, it gives an error saying "Internet Explorer cannot open hello.tar.gz from server"
Edit: Forgot to mention that IE 7 / 8 works fine without SSL.
Please help!
-Keshav
UPDATE: Solved the problem with a tomcat 6 configuration. Here is the link that helped me solve the problem-
http://community.eapps.com/showthread.php?p=461
IE normally downloads attachments into its "Temporary Internet Files" folder, however when the site is in HTTPS mode the attachments will not be downloaded.
Theres detailed explanation in this article.
IE and HTTPS for the whole site with a '/' as the url-pattern
Hope this helps.
Have you configured the MIME types for the file extension *.gz (or *.tar.gz)?
It sounds like IE is trying to interpret the file as gzipped HTML, instead of prompting to download it.