Downloading a file using a file url - html

click here to download :
Download image
Download image
When I try download the file within the folder that the html code is found, it works perfectly. But when I specify a specific URL, then it does not work.

Try using File URI scheme.
Something like file://c/users/user/Desktop/Strectching.jpg
Im not sure for synthax now on Windows but it should be like i wrote below

Download image
It will open the file in a new tab and there you can download it. If the extension of the file is not familiar with the browser, it will prompt you whether to download it or open it with an application

Related

is it possible to make an hyperlink to only download a pdf file?

I have an hyperlink to a pdf form that can not be opened by the browser's pdf viewer. If clicked, the browser tries to show it but I get the error message like "it is necessary Acrobat Reader 8.x" etc. Is there a way to force an hyperlink to such pdf form file to only allow its downloading? In this way, the user could open it with his local Adobe Reader.
Let’s say you have a PDF that you want to let people download. The file will be like this:
Download Receipt
In most browsers, clicking on the link will open the file directly in the browser.
But, if you add the download attribute to the link, it will tell the browser to download the file instead.
<a href="/path/to/your/receipt.pdf" download>Download Receipt</a>
The download attribute works in all modern browsers, including MS Edge, but not Internet Explorer.
In the latest versions of Chrome, you cannot download cross-origin files (they have to be hosted on the same domain).
To make the hyperlink to download the pdf file when clicked, you should use download property inside the anchor tag. For example you can see the code below:
Download the pdf file
You can also give your own name to the downloadable pdf file in the download property that I provided as 'Document' in the code above.
Yes, it is possible. First download the file and then you'll see a link when it downloaded(it disappears quite quickly) just copy it and use:
hyperlink

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.

Chrome automatically download local file

I want to view the markdown file in my Chrome browser; however when I open the local markdown file it download the file in my local directory. However, I tried with TXT file and browser address location looks - file:///C:/ that works fine though. The same approach like TXT file does not work for markdown file.
Any suggestion will be greatly appreciate. Thank you !
Chrome will not support the all content type it will support only some specified content type. If you want to show the file into your browser you need to set the headers.
Here is the GITHUB Block how they show all files
https://github.com/blog/1482-heads-up-nosniff-header-support-coming-to-chrome-and-firefox

stop asking for download an embedded file on unavailability of plugin to display

I'd embedded a pdf file on my page. On some browsers it shows properly that pdf file but on some browser instead of showing that file it ask me to download that file.
One of the possible reason could be unavailability of plugin in the browser to display the file.
But I want that if it was unable to show do not ask the file to download.
URL for reference
You can use the https://docs.google.com/viewer to accomplish this.
All you do is enter the link and it wil generate a link
Use an iframe with that link to get it embedded