Board index » html » A simple question... How to start a file download?

A simple question... How to start a file download?

2005-09-01 06:09:00 AM
hi there...
can someone please explain to me how I get a browser to start downloading an
Excel spreadsheet from the host server.
I've experimented with
<a href=ftp"www.site.com/file.xls">Dowload xls NOW!<a>
but not happening. Am I on the right track??? tnx
-
 

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote
hi there...
can someone please explain to me how I get a browser to start downloading an
Excel spreadsheet from the host server.

I've experimented with

<a href=ftp"www.site.com/file.xls">Dowload xls NOW!<a>

but not happening. Am I on the right track??? tnx
Kill the "ftp".
--
Blinky Linux Registered User 297263
Killing All Posts from GG: blinkynet.net/comp/uip5.html
End Of The Good GG Archive GUI: blinkynet.net/comp/gggui.html
-

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote
hi there...
can someone please explain to me how I get a browser to start downloading an
Excel spreadsheet from the host server.

I've experimented with

<a href=ftp"www.site.com/file.xls">Dowload xls NOW!<a>

but not happening. Am I on the right track??? tnx
What I said...and make that final tag a CLOSE anchor tag, if it's
really <a>in your code.
--
Blinky Linux Registered User 297263
Killing All Posts from GG: blinkynet.net/comp/uip5.html
End Of The Good GG Archive GUI: blinkynet.net/comp/gggui.html
-

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote
hi there...
can someone please explain to me how I get a browser to start downloading
an Excel spreadsheet from the host server.

I've experimented with

<a href=ftp"www.site.com/file.xls">Dowload xls NOW!<a>

but not happening. Am I on the right track??? tnx
I think
<a href="www.site.com/file.xls">Dowload xls NOW!</a>
is what you want.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: www.odahoda.de/
-

Re:A simple question... How to start a file download?

Quote
What I said...and make that final tag a CLOSE anchor tag, if it's
really <a>in your code.


Yeah.. but that just opens the file in the browser... I actually want to
save the fiel to local...
-

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote
What I said...and make that final tag a CLOSE anchor tag, if it's
really <a>in your code.




Yeah.. but that just opens the file in the browser... I actually want to
save the fiel to local...


You have no control over that, and there is no way around it. Just put a
line of text that says "Right-click this link and choose 'Save As...' to
save this file to your computer." For most people that will work.
There's no smart way of forcing the file to download to a users desktop.
--
x theSpaceGirl (miranda)
# lead designer @ www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
# this post (c) Miranda Thomas 2005
# explicitly no permission given to Forum4Designers
# to duplicate this post.
-

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote

Quote
What I said...and make that final tag a CLOSE anchor tag, if it's
really <a>in your code.

Yeah.. but that just opens the file in the browser... I actually want to
save the fiel to local...
Okay, Peter.
--
Blinky Linux Registered User 297263
Killing All Posts from GG: blinkynet.net/comp/uip5.html
End Of The Good GG Archive GUI: blinkynet.net/comp/gggui.html
-

Re:A simple question... How to start a file download?

Peter Butler wrote:
Quote

Quote
What I said...and make that final tag a CLOSE anchor tag, if it's
really <a>in your code.



Yeah.. but that just opens the file in the browser... I actually want to
save the fiel to local...
If you are really using the ftp protocol, then there's no way to control
this AFAIK.
With http you can set the Content-Disposition header with either a
server-side language (e.g. PHP) or an appropriate server configuration (and
a user-agent *may* decide to open a 'Save as...' dialog instead of opening
it in the browser).
The same question has been asked a few days ago. Look for the thread 'saving
files to a pc'.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: www.odahoda.de/
-

Re:A simple question... How to start a file download?

Benjamin Niemann wrote:
<snip>
Quote

I think
<a href="www.site.com/file.xls">Dowload xls NOW!</a>
is what you want.

Will not work unless server is setup for ftp, and ftp usually(always?)
requires a user and password login.
I do remember reading somewhere of some hacks of trying to encode the
user & password in a url...but if there is a way I believe this is NOT
the route your should take.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
www.LittleWorksStudio.com
-

Re:A simple question... How to start a file download?

Jonathan N. Little wrote:
Quote
Benjamin Niemann wrote:
<snip>
Quote

I think
<a href="www.site.com/file.xls">Dowload xls NOW!</a>
is what you want.

Will not work unless server is setup for ftp,
I assume that the OP has a working ftp server and is just struggling with
the proper HTML syntax.
Quote
and ftp usually(always?)
requires a user and password login.
Browsers will usually try to login as 'anonymous' with an arbitrary (or the
email of the user, if available) password. If the ftp server is properly
configured, this will work just fine. Most ftp servers have anonymous read
access enabled as default.
Quote
I do remember reading somewhere of some hacks of trying to encode the
user & password in a url...but if there is a way I believe this is NOT
the route your should take.
That's not a hack.
ftp://username@host/path or ftp://username:password@host/path are valid ftp
URLs - though the latter form should not be used, as the password looses
its meaning, if it available on website or in someones bookmark collection.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: www.odahoda.de/
-