Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have a <a href="cb289e02-ed2b-4daa-">pdf</a> save with a more descriptive filename?

Tags:

html

I have a document that is accessible from a url such as http://www.myCompany.com/Documents/cb289e02-ed2b-4daa-8. I am using

<a href="http://www.myCompany.com/Documents/cb289e02-ed2b-4daa-8">TitleCodeReport</a> In an email that is being sent to the users of this report.

I want to make a link so that when the user clicks it, it will save with a friendlier name like TitleCodeReport.pdf instead of cb289e02-ed2b-4daa-8. Any idea how I would do that?

like image 361
anthonybell Avatar asked Mar 23 '23 15:03

anthonybell


1 Answers

You can do this in HTML with the HTML5 download attribute.

<a href="http://foo.com/files/adlafjlxjewfasd89asd8f.pdf" download="foo.pdf">Download It</a>
like image 87
Paul Schreiber Avatar answered Apr 06 '23 21:04

Paul Schreiber