From personal experience I have not seen a way to download a whole directory. You would probably have to dynamically zip the folder up and make the resulting zip downloadable.
In HTML 5 you could use something like this to download a single file
<a href="/files/name-of-pdf.pdf" download="name-of-pdf">Download Your PDF</a>
The download attribute will force a download dialog for the user.
Hope this puts you on the right track and maybe someone can prove me wrong on that directory download.
Answer from dkenkatewal on Stack OverflowVideos
From personal experience I have not seen a way to download a whole directory. You would probably have to dynamically zip the folder up and make the resulting zip downloadable.
In HTML 5 you could use something like this to download a single file
<a href="/files/name-of-pdf.pdf" download="name-of-pdf">Download Your PDF</a>
The download attribute will force a download dialog for the user.
Hope this puts you on the right track and maybe someone can prove me wrong on that directory download.
I don't think there's a way to create a direct link to download a folder, But this is a great alternative if you want users to download your "my_folder"
- upload your folder to any online file storage service provider (like Google Drive or Dropbox).
- Place that inside another folder say "parentfolder"
- Get the link for the "parentfolder" and add that into your website's HTML (make sure to change viewing setting to anyone with the link)
You'll probably want to set :
target="_blank"
in your 'a' tag
Now, when user clicks the link it redirects to your drive and shows "my_folder" which they can either download or open to see the "my_file"
Hi Brian,
How come I can create a direct download link when I embed a single file (including a zipped folder) by replacing "embed" with "download" but it doesn't work for a normal folder?
I sell digital templates and house them within my OneDrive. The platform I sell on has file size limitations so I have to store my files on a cloud such as OneDrive. However, I do not want to share access to the onedrive folder directly for security reasons. So I am looking for an option to provide a forced/direct download link to contents within a OneDrive folder.
In the past, I have zipped my files before uploading to OneDrive and I have successfully been able to create direct download links using the trick of using the embed link and replacing embed with download which has worked.
But manually zipping files becomes a hassle when I update my digital templates and it would be easier if they just had a direct download link to download the contents within the OneDrive folder without ever going into the folder itself.
Hi. I'm Brian.
I don't see any way to accomplish what you request. If you share a link to a folder, it will allow the person connecting to that link will see the folder contents and can download what they wish from it. You can't generate a link that will automatically download a folder, as far as I can tell.
This is probably a super simple question to answer, but I've yet to find an answer to it by searching. How can I provide a link to have a file download? For example, if I had a document on my webpage, and someone wanted a copy of it, they would click on the link and it would download. How difficult is that to implement? Thanks!
The API I am working with allows me to upload a file from a URL onto their application.
I was able to do this by using a direct download link to a file on my google drive. I simply put that direct download link into the url parameter of the http request.
How can I do something similar with a file on my local computer? Is there some way I can create a download link, similar to the google drive one, which I can then just use for the url parameter and then send the request so their server has my file?