Download file using <a>?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
mikeeeeeeey
Forum Contributor
Posts: 130
Joined: Mon Jul 03, 2006 4:17 am
Location: Huddersfield, UK

Download file using <a>?

Post by mikeeeeeeey »

Hi guys, good morning :)

Just a bit of a niggle, got a CMS on the go and the client wants buttons to be able to open AND download the files parsed in the directory.

I don't actually know if there's a difference in how you would set these up i.e.

Code: Select all

<a href="dir/file.ext">download me</a>
...would work for both, but is there nothing I can do to force a download rather than opening?

Thanks in advance :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Sending it through a script that does a forced download.
Post Reply