473,672 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Links that download for sure

I have had problems several times with links to files to download. In one
case I had a text file with different extension than txt, that, in case the
user has the associated application installed, it could be opened with that,
or otherwise downloaded. The problem was that in some clients, the browser
displayed the file, wich was not the intended purpose and was useless for
the visitors.

Another time I had the more common challenge of allowing users downloading
pdf files instead of viewing them in their browser in case they had the
plugin installed.

I know a common answer would be to zip the files, but some users... you
know, are not even zip self confident so to speak.

How can I make sure, with a client side solution, the link triggers a
download? I tried to look for a javascript function but I am not advanced on
it so I couldn't find a way.

Thanks
Jul 23 '05 #1
14 1333
On Sat, 30 Oct 2004 14:28:41 -0300, Simon Templar <po********@gmx .co.uk>
wrote:

[snip]
How can I make sure, with a client side solution, the link triggers a
download? I tried to look for a javascript function but I am not
advanced on it so I couldn't find a way.


That's because it's not possible. See the (clj) FAQ
(<URL:http://jibbering.com/faq/>).

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
In alt.www.webmaster,comp.lang.javascript Simon Templar said:
I have had problems several times with links to files to download.
you have no control over what happens when a link to a file is clicked
and you cant force anything. if a person wants to download the file
instead of opening it in the browser window or in some other application
they should know what to do (and you don't know what they want to do so
you shouldn't try to guess for them).

if your visitors do not know how to download a file without opening it
in the browser supply instructions for the common browsers and those
shown in your server stats.
In one case I had a text file with different extension than txt,
idiot
The problem was that in some clients, the browser displayed the file,
wich was not the intended purpose and was useless for the visitors.
if you want a "save dialog" then change *your* preferences.
Another time I had the more common challenge of allowing users downloading
pdf files instead of viewing them in their browser


acrobat has the option to turn off browser integration. simple, you
don't need to do anything.
--

v o i c e s o f t h e l i t t l e
Jul 23 '05 #3
brucie wrote:
In alt.www.webmaster,comp.lang.javascript Simon Templar said:

[snip]
In one case I had a text file with different extension than txt,

idiot

[snip]

Really? So what extension would you give an ASCII file with comma
separated values? Seems to me that would be .csv (or .csf for some) and
if the user doesn't have .csv assigned to any particular application
(Windows will assign it to Excel by default IF you have Excel) it will
be displayed in the browser as text.

There are many more examples, please don't be so quick to judge, or so
rude in your language.

Zif.
Jul 23 '05 #4
In alt.www.webmaster,comp.lang.javascript Zifud said:
In one case I had a text file with different extension than txt,
idiot
Really?
no i was wrong i should have said fucking idiot.
So what extension would you give an ASCII file with comma
separated values? Seems to me that would be .csv (or .csf for some) and
if the user doesn't have .csv assigned to any particular application
(Windows will assign it to Excel by default IF you have Excel) it will
be displayed in the browser as text.
he can use any cute little 3 letters he wants to, even more or less or
even none at all if it gives him a thrill, it doesn't matter. what does
matter is the mime the server sends with the file to identify what it
is.
There are many more examples, please don't be so quick to judge, or so
rude in your language.


some people are just no fucking fun at all

--

v o i c e s o f t h e l i t t l e
Jul 23 '05 #5
Zifud wrote:
brucie wrote:
Simon Templar said:
In one case I had a text file with different extension than txt,


idiot


Really? So what extension would you give an ASCII file with comma
separated values?


Brucie's point was that extensions are entirely a Windows thing. There is
no such thing as an extension on the web.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #6
Toby Inkster wrote:
[snip]
Brucie's point was that extensions are entirely a Windows thing. There is
no such thing as an extension on the web.


Then perhaps Brucie could have said as much, in similar language.

Zif.
Jul 23 '05 #7
Zifud wrote:
Then perhaps Brucie could have said as much


He did in his own way.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./oasis/the_masterplan. ogg

Jul 23 '05 #8
Well, this deserves a clarification due to the quick assesment this
gentleman, brucie, makes. The text file extension is pgn, an absolute
standard in chess games database for its interchangeabil ity over the net.
The problem is chess players and amateurs are not always versant in zip
files, so they feel more comfrotable just by even directly opening the file
from the web server, and it would automatically fire up their chess database
application associated with this extension.

Enough

"brucie" <sh**@usenetshi t.info> escribió en el mensaje
news:z1******** *******@usenets hit.info...
In alt.www.webmaster,comp.lang.javascript Zifud said:
In one case I had a text file with different extension than txt, idiot

Really?


no i was wrong i should have said fucking idiot.
So what extension would you give an ASCII file with comma
separated values? Seems to me that would be .csv (or .csf for some) and
if the user doesn't have .csv assigned to any particular application
(Windows will assign it to Excel by default IF you have Excel) it will
be displayed in the browser as text.


he can use any cute little 3 letters he wants to, even more or less or
even none at all if it gives him a thrill, it doesn't matter. what does
matter is the mime the server sends with the file to identify what it
is.
There are many more examples, please don't be so quick to judge, or so
rude in your language.


some people are just no fucking fun at all

--

v o i c e s o f t h e l i t t l e

Jul 23 '05 #9
Well in the case of pgn chess standard files, as I pointed in another post
to this thread, even Linux and Mac applications look for this extensions.
The point is, that if the file is shown in a browser window, you can read
the notation and relevant data of the games, such as who played with white
and black pieces, tournament, year, etc., but can't replay the game, except
you open an application and enter the moves manually. The pgn files are
supported by dozens of chess applications, which when reading these files,
immediately allow the user to replay the games just by clicking a forward
arrow below a chess board, and switching from game to game without the
hassle of rearranging the pieces back to their starting position. In fact
this is its primary advantage! So, for chess related sites, it is very
important to make sure the user will be able to download the file
independently of the browser configuration, OS, etc. The suggestion to put
an advice on right clicking the link and choosing to save, would be an
intermediate solution. I wonder if there is any way, even server side in php
or asp to solve this and make everythinng friendlier to the user, or in
other words, more usable.
"Toby Inkster" <us**********@t obyinkster.co.u k> escribió en el mensaje
news:pa******** *************** *****@tobyinkst er.co.uk...
Zifud wrote:
brucie wrote:
Simon Templar said:

In one case I had a text file with different extension than txt,

idiot


Really? So what extension would you give an ASCII file with comma
separated values?


Brucie's point was that extensions are entirely a Windows thing. There is
no such thing as an extension on the web.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1858
by: timbratureman | last post by:
I have a txt file in my server. I have to provide to the user 2 links. One link is to download the file and the other one is to display it inside the browser. Is it possible? I made <a href="file.txt">Download the file</a> but it display it, and it does not ask me to download it. (of course I could download it by clicking the right button, but my boss doesn't want that: he wants 2 different links).
0
1511
by: Raymond Hettinger | last post by:
QOTW: "Python seems to encourage and reward incremental effort, and it leads one to explore extensions and improvements to programs because the language makes it relatively easy to see how to do the extensions." -- Ron Stephens "When writing programs in Python, write Python programs" -- Jeff Epler's advice to those forcing themselves to write code using idioms learned in other languages "Oh come on, now, just because Java does it..."...
2
1292
by: Many Links | last post by:
Hey! I am creating a spot where people can redownload items if they have access. I have everything written but the part where people actually get to the page due to a huge issue. So far there are 96 uniquie combinations of the 8 items they can download. Here is the flow of my system.
1
1723
by: Carl Cross | last post by:
I have a site http://www.allaboutpets.org.uk/dogindex1.html Now on all of the cat doh horse index pages when using netscape browser ( all versions ) the download links in the left column do not work. If you try using PC Explorer ( all versions 4 and above ) the links work fine.
7
10550
by: Chris | last post by:
I'm using eight links listed horizontally as a menu on my site. I'm using font-variant:small-caps and they are padded so that they mimic buttons. My gripe is with the way IE handles the focus rectangle on these links. It insists on drawing this crazy shape that traces the text, which with small caps looks rather assinine. Firefox handles the same task very gracefully (yeah Gecko!) and I would like to force IE to do the same. The site...
0
978
by: Gabriel Genellina | last post by:
QOTW: "If there were a protein that could only be folded by proving the Riemann Hypothesis, the gene that coded for it would quickly get weeded out of the gene pool." - Scott Aaaronson http://scottaaronson.com/blog/?p=266 "We read Knuth so you don't have to." - Tim Peters The first Python 3000 release is out -- Python 3.0a1. Anouncement by Guido van Rossum:
16
2570
by: Martin Schneider | last post by:
Hi! I want to maintain a large file link list (to legal files, by the way :-)). The links should be protected from "grabbing", though. Is it possible to make the browser download a link without making the link itself public? Passing through the data is not an option due to legal issues in Germany, not mentioning the traffic. Thanks for your ideas and best regards,
0
8488
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8617
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8686
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7449
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2821
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1821
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.