"qq" wrote in message
news:CD**********************************@microsof t.com...
: Thank you for your help. Because Response.Redirect is just only for HTTP,
So
: I use the follows code.
:
: <% Dim username
: username = Request.Form("username") %>
: <% Dim password
: password = CStr(Request.Form("password")) %>
: <% Dim URL
: URL = "ftp://" & username & ":" & password & "@ftp.mysite.com"
: %>
:
: <html>
:
: <script language="vbscript">
:
: sub winopen(surl)
:
sfeature="toolbar=yes,location=yes,directories=yes ,status=yes,menubar=yes,scrollbars=yes,resizable=y es,width=680,height=500"
: window.open surl,null,sfeature
: 'any other things
: end sub
:
: </script>
:
: <body onload=winopen("<%= URL %>")>
:
: </body>
: </html>
:
: My problem is:
:
: <body onload=winopen("ftp://ftp.mysite.com")> works, I can got my ftp
: server, a login screen come up.
:
: But <body onload=winopen("ftp://test:pa*********@ftp.mysite.com")> doesn't
: working. And give me a error message:
: Cannot find 'ftp://test:password$/'. Make sure the path or Internet
address
: is correct.
:
: Could you give me some idea to figure out it? Or do you have any another
way
: to solve my problem? Thanks a lot.
I'm not sure why you need to open a new window with location.href would work
just fine.
Two more things:
1. language= is deprecated. use type="text/vbscript" instead.
2. Client-side VBScript should not be used on the Internet. Use javascript
instead.
Ok, it works for me but your password may have to be URL or HTML encoded
because of the characters in your password. I get a prompt to enter my
password but after I tell it to save it and log in once, it works from then
on. This means you probably only need:
ftp://us******@ftp.mysite.com
I'm not a fan of putting my password in a URL, even if it is passed in clear
text if entered manually.
The best thing to do is use secure FTP, which MSFT's FTP server doesn't
support or use WebDav over SSL or through a VPN tunnel.
If you can use PHP, this will also work: (this file would have to be called
ftp.php or change the action="")
<?
if($action=="login"){
Header ("Location: ftp://$username:$p*******@ftp.mysite.com");
}
?>
<form action="ftp.php?action=login" method="post" enctype="text/plain">
<table><tr><td>
username: <INPUT NAME="username" TYPE="text" SIZE=20><BR>
password: <INPUT NAME="password" TYPE="password" SIZE=20><BR>
</td></tr>
<tr><td align=center>
<INPUT TYPE="submit" value="submit" style="color: #ffffff; background-color:
#000000">
</td></tr></table>
</FORM>
HTH...
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp