
February 3rd, 2006, 07:55 PM
| | | force download of a file
Hi I have a large pdf file that if I create an anchor link to, the
browser will try to open the file, which takes quite a long time. Is
there a way to force the browser to download the file rather than try
to open it?
Thankss | 
February 3rd, 2006, 08:45 PM
| | | Re: force download of a file
thanks~ | 
February 3rd, 2006, 08:55 PM
| | | Re: force download of a file
ron1972 wrote:[color=blue]
> Hi I have a large pdf file that if I create an anchor link to, the
> browser will try to open the file, which takes quite a long time. Is
> there a way to force the browser to download the file rather than try
> to open it?[/color]
If the user's browser is configured to open the file by default, there's
nothing you can do about it. That's as it should be. After all, if it's
too large to open, why should the decision be up to you that it *isn't*
too large for the user to want to download at all?
The courteous approach is to annotate the link with the size of the
document. If you want to be extra helpful, you can suggest that the file
is really large and the user may want to download it instead--for
example, by choosing "Download this link" or a similar command from the
context menu available on some installations (a.k.a. "right-clicking",
but that isn't available to all web users). | 
February 4th, 2006, 01:55 AM
| | | Re: force download of a file
In our last episode,
<1138995814.604348.9730@g43g2000cwa.googlegroups.c om>,
the lovely and talented ron1972
broadcast on comp.infosystems. www.authoring.html:
[color=blue]
> Hi I have a large pdf file that if I create an anchor link to, the
> browser will try to open the file, which takes quite a long time. Is
> there a way to force the browser to download the file rather than try
> to open it?[/color]
If there is, it in your browser, not html. Consult your
browser's documentation or a newsqroup about the browser.
--
Lars Eighner usenet@larseighner.com http://www.larseighner.com/
War On Terrorism: Joe McCarthy Brigade
"The decadent left in its enclaves on the coasts is not dead -- and may well
mount a fifth column." Andrew Sullivan, _The New Republic_ | 
February 4th, 2006, 02:05 AM
| | | Re: force download of a file
ron1972 wrote:
[color=blue]
> Hi I have a large pdf file that if I create an anchor link to, the
> browser will try to open the file, which takes quite a long time. Is
> there a way to force the browser to download the file rather than try
> to open it?[/color]
The only surefire way would be to put it into a .zip file and link to
that instead.
Browsers are configured differently, depending on installed software,
installation standard settings and user preferences, and will handle
certain file types differently. Personally, I use Opera as my standard
browser, which is set to download everything that isn't presented as
HTML/XML, images, plugins or Java (the display of the latter two also
depends on my browser settings at the time, I usually leave them
disabled unless I really need them).
--
Kim André Akerĝ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly) | 
February 4th, 2006, 03:55 AM
| | | Re: force download of a file
ron1972 wrote:[color=blue]
> Hi I have a large pdf file that if I create an anchor link to, the
> browser will try to open the file, which takes quite a long time. Is
> there a way to force the browser to download the file rather than try
> to open it?[/color]
Firefox users may choose to install the PDF Download extension which
allows them to easily decide for themselves. https://addons.mozilla.org/extension...firefox&id=636
Other browsers may have similar options/extensions available to them, or
at least the ability to choose Save Link As... (or equivalent).
--
Lachlan Hunt http://lachy.id.au/ http://GetFirefox.com/ Rediscover the Web http://GetThunderbird.com/ Reclaim your Inbox | 
February 4th, 2006, 09:45 AM
| | | Re: force download of a file
On Sat, 4 Feb 2006, Kim André Akerĝ wrote:
[color=blue]
> The only surefire way would be to put it into a .zip file and link to
> that instead.[/color]
Nope. One of my browsers opens .zip files in a viewer. | 
February 4th, 2006, 07:45 PM
| | | Re: force download of a file
4 Feb 2006 01:55:39 GMT from Kim André Akerĝ
<kimandre@NOSPAMbetadome.com>:[color=blue]
> ron1972 wrote:
>[color=green]
> > Hi I have a large pdf file that if I create an anchor link to, the
> > browser will try to open the file, which takes quite a long time. Is
> > there a way to force the browser to download the file rather than try
> > to open it?[/color]
>
> The only surefire way would be to put it into a .zip file and link to
> that instead.[/color]
That is not "sure fire" either. A user could have the browser
configured to open ZIP files when they're clicked on.
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://diveintomark.org/archives/200..._wont_help_you | 
February 21st, 2006, 06:45 PM
| | | Re: force download of a file
Alan J. Flavell wrote:[color=blue]
> On Sat, 4 Feb 2006, Kim André Akerĝ wrote:
>[color=green]
>> The only surefire way would be to put it into a .zip file and link to
>> that instead.[/color]
>
> Nope. One of my browsers opens .zip files in a viewer.[/color]
No offense intended, but if you have a browser that opens zips as a text
file instead of downloading them, then something is either horribly
miscponfigured, or if it's stock, it's probably either out of date, or
probably one no one used... I can't imagine such a broken browser ever
being popular, and yes, any graphical browser that doesn't know how to
treat such as well known binary (even just by ".zip" extension) is
considered broken.
For non graphical browsers, like Lynx, I can understand, but there just
isn't any excuse for graphical browsers.
What browser and platform was this? | 
February 21st, 2006, 07:05 PM
| | | Re: force download of a file
On Tue, 21 Feb 2006, bliz wrote:
[color=blue]
> Alan J. Flavell wrote:[color=green]
> >
> > Nope. One of my browsers opens .zip files in a viewer.[/color]
>
> No offense intended, but if you have a browser that opens zips as a
> text file[/color]
Oh no, who said anything about a "text file"? I'm talking about a zip
viewer - the browser recognises the content-type, fires-up the viewer,
the viewer unpacks the .zip directory and offers the index of its
contents, waiting for me to decide what to do next.
[color=blue]
> What browser and platform was this?[/color]
But any halfways decent browser can be configured to associate any
given content-type with a suitable viewer for that content-type.
That's how the web has worked since its early days.
You know, I once persuaded MSIE to associate application/xhtml+xml
with Mozilla: so, whenever that IE was asked to open a real XHTML
file, it would fire-up Mozilla and view it there. Possibly not what
its vendor intended, but why should I care... | 
February 21st, 2006, 07:05 PM
| | | Re: force download of a file
Kim André Akerĝ wrote:[color=blue][color=green][color=darkred]
>>> The only surefire way would be to put it into a .zip file and link to
>>> that instead.[/color][/color][/color]
Alan J. Flavell wrote:[color=blue][color=green]
>> Nope. One of my browsers opens .zip files in a viewer.[/color][/color]
bliz <bliz@aspamlessworld.cum> wrote:[color=blue]
> No offense intended, but if you have a browser that opens zips as a text
> file instead of downloading them,[/color]
Who said anything about opening .zip files as text files?
I would assume that .zip files would be sent as "application/zip" and
opened in a viewer that knows how to view the contents of a zip archive.
I've used browsers configured to use such viewers myself.
--
Darin McGrew, mcgrew@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin@htmlhelp.com, http://www.HTMLHelp.com/
"No matter how far you have gone on the wrong road, turn back." | 
February 21st, 2006, 07:15 PM
| | | Re: force download of a file
Alan J. Flavell wrote:[color=blue]
> On Tue, 21 Feb 2006, bliz wrote:
>[color=green]
>> Alan J. Flavell wrote:[color=darkred]
>>>
>>> Nope. One of my browsers opens .zip files in a viewer.[/color]
>>
>> No offense intended, but if you have a browser that opens zips as a
>> text file[/color]
>
> Oh no, who said anything about a "text file"? I'm talking about a zip
> viewer - the browser recognises the content-type, fires-up the viewer,
> the viewer unpacks the .zip directory and offers the index of its
> contents, waiting for me to decide what to do next.[/color]
Ok, sorry for making that assumption. I would like to argue that it's
better to have the browser ask you weather ou want to Save or Open /any/
binary type isntead of automatically opening it. Automatic opening can
lead to security problems, on any OS.
[...]
[color=blue]
> You know, I once persuaded MSIE to associate application/xhtml+xml
> with Mozilla: so, whenever that IE was asked to open a real XHTML
> file, it would fire-up Mozilla and view it there. Possibly not what
> its vendor intended, but why should I care...[/color]
It's not that hard to configure IE contrary to popular belief :-P | 
February 22nd, 2006, 03:25 PM
| | | Re: force download of a file
On Tue, 21 Feb 2006, bliz wrote:
[color=blue]
> Ok, sorry for making that assumption. I would like to argue that
> it's better to have the browser ask you weather ou want to Save or
> Open /any/ binary type isntead of automatically opening it.[/color]
Sure: it's a configuration option to have the browser prompt me
whether I want to view it in the zip viewer application, or download
it, etc.
[color=blue]
> Automatic opening can lead to security problems, on any OS.[/color]
Point taken, but if I'm only viewing the directory, then the crackers
have to find some way of compromising the zip-viewer's
directory-viewing code; or fooling the zip-viewer into telling me lies
about what it is I'm seeing, to the point that I would be tempted to
open the actual content in some unsafe way.
I wasn't for a moment suggesting that the zip viewer would go and
execute any programs it might find in the archive, without my consent.
And of course in 99% of cases I would be doing this from my
unprivileged user account, not from my wizard's account. I avoid
using the latter except when I'm actually intending to install some
program - from what seems to be a trustworthy source. Can't be 100%
sure, obviously, because even trusted sources have occasionally been
compromised. But the policy has kept me safe enough, for many years
now.
[color=blue][color=green]
> > so, whenever that IE was asked to open a real XHTML
> > file, it would fire-up Mozilla and view it there.[/color]
>
> It's not that hard to configure IE contrary to popular belief :-P[/color]
I worked out how to do that in Win/NT4, but there doesn't seem to be a
user interface for it in 2K or XP. Fortunately, most of my
sysadminning is on linux, and none of my general web browsing on MSIE,
so I don't much care whether Windows has a UI for it or not; but I'd
be vaguely interested, nevertheless, and it might be of interest to
other readers.
all the best |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|