login to ftp from a web link

S

sb

Ok, this has got to be a common problem...
I want to have a page with some files listed as links to the files actually
located on a remote(unix) server (different one to my IIS). In ASP I
dynamically build the url to be:

ftp://username:password@servername/dir1/dir2/filename.gz

....other than it displays the username/password, this should work (the
username/password can be hidden by having it redirect to another page).
Problem is I get a DNS error on the first attempt. The wierd thing is that
if I type this url into the Address bar of my browser it firstly gives me
the dns error and then on the second time works!

My theory of what is happening is that the first time through it logged into
the ftp server, then the second time it logs straight in without the need
for the password. Has anyone had the same problem and found a fix?

I assume this is some kind of security block, but it is kind of annoing
given how easy it would be to implement ftp ability to web sites with no
code on the client.

I am using IIS5 and ASP and vbscript.

Please reply to this newsgroup as my email is a dummy.

SB
 
R

Ray at

It's probably because you're linking to a filename instead of the directory
containing the filename.

If the remote server will support it, you could setup a virtual directory in
IIS that goes to \\otherserver\share and store your username and password
within IIS for the virtual directory.

Ray at home
 
R

Ray at

Alright, then remove the filename from your path. You'll notice that if you
copy and paste that link into your browser, it won't work. You have to
browse to the directory with the file, not to the file itself. I don't
think there's any automatic GET command sent if you browse to a file.

Ray at home
 
S

sb

Let me put it another way.
This works:
ftp://ftp.microsoft.com/Softlib/MSLFILES/TBKNET.EXE

....however if it was not anonymous, then this would be required...
ftp://auser:p[email protected]/Softlib/MSLFILES/TBKNET.EXE

....this does not work the first time. But the second time it does!

SB
 
R

Ray at

What happens? Do you get a prompt to download the exe? Does it run? In my
browse, IE6, if I enter an ftp path to a file, that does not work, auth or
anon.

Ray at home
 
S

sb

Yes a prompt to download the file appears.
SB

Ray at said:
What happens? Do you get a prompt to download the exe? Does it run? In my
browse, IE6, if I enter an ftp path to a file, that does not work, auth or
anon.

Ray at home

ASP
 

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
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top