change download link filename |
change download link filename |
hedehede |
Jun 26 2016, 09:34 AM
Post
#1
|
Group: Members Posts: 1 Joined: 26-June 16 Member No.: 24,364 |
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? |
pandy |
Jun 26 2016, 01:12 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
No. Rename the file on the server.
|
Frederiek |
Jun 27 2016, 04:26 AM
Post
#3
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
I think it can be done. Try searching for "change filename on download".
|
pandy |
Jun 27 2016, 05:44 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I, maybe incorrectly, got the impression that server side wasn't an option.
|
Christian J |
Jun 27 2016, 07:44 AM
Post
#5
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
HTML5's DOWNLOAD attribute lets you specify a default file name, like this:
CODE <a href="file.php?id=746345465400132761" download="foo.txt">download file</a> Browser support is still limited: http://caniuse.com/#search=download See also https://www.w3.org/TR/2014/REC-html5-201410...erlink-download |
pandy |
Jun 27 2016, 08:21 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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 |
Jun 27 2016, 08:35 AM
Post
#7
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
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.
|
pandy |
Jun 27 2016, 03:32 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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. |
Themeaxe |
Jul 18 2016, 06:30 AM
Post
#9
|
Newbie Group: Members Posts: 10 Joined: 18-July 16 Member No.: 24,423 |
This actually possible with JavaScript. Though browser support would be spotty. Google chrome is best for this solution.
|
Lo-Fi Version | Time is now: 19th April 2024 - 06:32 AM |