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

P

Peter Butler

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
 
B

Blinky the Shark

Peter said:
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".
 
B

Blinky the Shark

Peter said:
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.
 
P

Peter Butler

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...
 
S

SpaceGirl

Peter said:
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 @ http://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.
 
B

Benjamin Niemann

Peter said:
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'.
 
J

Jonathan N. Little

Benjamin Niemann wrote:
I think
<a href="ftp://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.
 
B

Benjamin Niemann

Jonathan said:
Benjamin Niemann wrote:

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.
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.
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top