Sharepoint - How to get a Download link for a document in SharePoint library for anonymous users

To get the direct download link, you have to click on the document, get the share link which will look like below url

https://sitename-my.sharepoint.com/personal/xyz/_layouts/15/guestaccess.aspx?guestaccesstoken=xyz%3d&docid=xyz&rev=1

Now all you have to do is replace the guestacces.aspx with download.aspx, and the url should look like the one below

https://sitename-my.sharepoint.com/personal/xyz/_layouts/15/download.aspx?guestaccesstoken=xyz%3d&docid=xyz&rev=1

When people click the link the document will automatically start to download


You should be able to add the query string parameter `Web=0'

For example:

https://sitename-my.sharepoint.com/personal/vignesh/Documents/SomePresentation.pptx?Web=0


Adding ?Web=0 worked perfectly. Thanks for your assistance.