iOs download pictures in photos instead of files - javascript

I have a website that provides images and I give users the possibility to download them.
There is an issue with the iOs users, the photos that are downloaded thanks to the button I made, go directly to the "Downloads" folder of the iPhone. (See #1)
The only way for the photos to go to the right folder is to make a long click on the photo and click on "Add to Photos". (See #2)
I would like these photos to be downloaded to the photo folder by clicking on the button.
Is there a solution?
#1 / <a href="photo.jpg" download> Download </a>
#2 /
Thank you

Related

HTML video automatically download

I want to use javascript to automatically download a video file given a url that contains the link to the video. So far I have tried the approach of using <a href='somelink' download> but when I click on the link it will open a new tab containing the video instead of downloading it. Is there a way to write a script that automatically does the job that the video tag control options does? Like the picture shown below, can I write javascript to trigger the event on the download button? Thanks.
This might helpful.
document.getElementById("myCheck").click();
<a download="name_of_downloaded_file" href="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" id="myCheck"> Clicking on this link will force download the file</a>
Use target=”_blank” along with anchor tag with download option to prevent streaming files directly in browsers on desktop and android or iOS (iPhone) devices.
<a href='somelink' download target=”_blank”>
Here is the reference

How to create a link/button to allow download for cross-origin image

Im new to JS. I am currently trying to implement a link/button that will download an image to the user's computer. The image will not be from the same url but a completely different one: for example, some random URL like this one. What I tried doing is implementing the button like this:
<a href="https://cdn.akc.org/Marketplace/Breeds/Rottweiler_SERP.jpg" download=""</a>
But when ever i press the link, I am taken to another page showing the image but the download is not being initiated. Is there any way I can get the image to be downloaded once the user clicks the image/link?

How to force open "Save as..." dialog on left click for downloading file from remote server

I want to open "Save as..." dialog on left click on link for file downloading from not my servers. Main idea - create link for downloading image, image getting with bad name. I want to force edit it in browser dialog, before user download it.
You really can't force a save-as dialog. Sorry.
Alternative approach
When they click a link you can use javascript to show a prompt for a better name. When they have filled in the name you can use the html5 <a download="name"> attribute to provide a link that downloads with the better name.

Opening PowerPoint after clicking a html link

I have a link in my webpage. When someone clicks the link I want to start the PowerPoint application in the user's desktop with an image in the slide. There are too many of such links and so I can not create separate ppt files for each links.
I can do the following with excel.
<a href="http://localhost/excel/asheet.xls#Sheet2!D4">
This link will open the Excel file to the second page with the focus on cell D4
</a>
So is it possible to do something for PowerPoint like this
<a href="http://localhost/template.ppt#image1.jpg">
This link will open PowerPoint with image1.jpg in the slide.
</a>
Or any JavaScript hack will also help.

Download large PDF in javascript

I have a website which hosts large PDF documents, as well as some other file formats.
How can I open up a download-dialog box in javascript so that the user can save the document to their computer?
PDF always needs download (even for iframe / embed /object ) so do not use those as its then potential double overload on server, once to downlink and show then potentially a second time by the scripting (However if user selects the "save download as" button in viewer the download should be just once)
The answer is display a small image or icon to show the download content, then back that up with
<Img src="cover.png">
something like this:-
<a href="https://africau.edu/images/default/sample.pdf" download="A Sample.pdf"><img src="https://www.freeiconspng.com/uploads/download-pdf-icon-png-icon-29.png" width="128" height="128"><a><br>right click icon to chose download options
note clicking the icon may show a blank page based on browser security, that is normal, hence the suggestion the user uses their discretion.

Categories