The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> change download link filename
hedehede
post 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?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post 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".
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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. ninja.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Themeaxe
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 06:32 AM