Unable to download files : I am using anchor tag to download file but the localhost is appended to it and the link is jumbled up

<a target="_blank" href=`{{url}}` download>Download {{body}}</a> 

This is the code I am using.

href link should be https://matrix-client.matrix.org/_matrix/media/r00/download/matrix.org/dsgakdgaksgd

wrong href link is http://localhost:3000/%60https://matrix-client.matrix.org/_matrix/media/r00/download/matrix.org/dsgakdgaksgd%60

Can anyone explain why this is happening?

Add Comment
1 Answer(s)

To redirect the user to an absolute path, the HTML anchor tag should contain the following properties.

<a href="https://matrix-client.matrix.org/_matrix/media/r00/download/matrix.org/dsgakdgaksgd" target="_blank" download>Download {{body}}</a> 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.