Forum Discussion
Download link, download form
HI Adin_Calkic Thanks! Tomorrow I will try again. I have tried many different ways, but the issue is if I right-click the file and then copy the link, then I paste the link into the home page it will just open the file in the browser, not download the file.
- Sk-73May 20, 2022Iron Contributor
HiAdin_Calkic Thanks. Sorry to tell u, but copy the path, the link I paste to the homepage when I click on the hyperlink on the homepage, still opens the doc in the browser.
I found an article and this work for me. https://www.sharepointdiary.com/2020/05/sharepoint-online-link-to-document-download-instead-of-open.html#:~:text=Just%20navigate%20to%20the%20document,%26download%3D1%E2%80%9D%20to%20it.&text=This%20URL%20directly%20links%20to%20document%20the%20download%20in%20SharePoint%20Online Just would like to share with u.
Cheers 👍
- Adin_CalkicMay 20, 2022Iron Contributor
- RobElliottMay 20, 2022Silver Contributor
Sk-73 the download button in the library is a JSON-formatted button. Create a single line of text column and select Format this column and choose Advanced mode. Then paste in the following JSON changing anything to taste:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "style": { "border-radius": "5px", "margin": "1px", "padding": "0px", "visibility": "=if([$ContentType] == 'Folder', 'hidden', 'visible')" }, "children": [ { "elmType": "a", "txtContent": "Download", "style": { "text-decoration": "none", "padding": "10px 0px", "width": "100%", "color": "white", "background-color": "Teal" }, "attributes": { "href": "= @currentWeb + '/_layouts/15/download.aspx?UniqueId=' + [$UniqueId]", "target": "_blank" } } ] }
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)- Sk-73May 23, 2022Iron Contributor
Hi RobElliott Thank you so much!
- Sk-73May 19, 2022Iron ContributorYes, I haven't tried copying the path. I will update u again. Thanks, Adin!