Help - Search - Members - Calendar
Full Version: change download link filename
HTMLHelp Forums > Web Authoring > Web Site Functionality
hi, im wordpress site manager and i using address link which if you open it file will be downloaded automatically
and i want when file is downloading change filename, problem is i didnt uploaded this file i just want to change file name when downloading, any code or something could help me?

No. Rename the file on the server.
I think it can be done. Try searching for "change filename on download".
I, maybe incorrectly, got the impression that server side wasn't an option.
Christian J
HTML5's DOWNLOAD attribute lets you specify a default file name, like this:

<a href="file.php?id=746345465400132761" download="foo.txt">download file</a>

Browser support is still limited:

See also
The behaviour is inconsistent even between the browsers it does work in. If the user chooses to rightclick and use Save link target as (or whatever the option is called) the latest FF will still rename the file whereas K-Mel (a few gecko versions behind) och Iron will not.
Christian J
Also it might feel a bit confusing/worrying to examine a file name in the statusbar, only to get an apparent different file once you open the link.
Yeah, that too. And I think most people would rightclick because that's what we are used too and how could they know this link is different if it doesn't explicitly say so on the page? Writing out "You don't need to rightclick this link to download the file. Just leftclick on it!" would be even more stupid than the old "Click here!".

I don't think I like this feature very much. ninja.gif
This actually possible with JavaScript. Though browser support would be spotty. Google chrome is best for this solution.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.