🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1921

Re: How to use ipworks.ftp to show list of remote files

#1921
From: Joi Ellis [TeamB]
Date: Thu, 16 Aug 2001 12:55
69 lines
3814 bytes
Fang Jing <fangjing21@chinaren.com> wrote:
> First I write a function to connect to the ftpserver(netflow FTP server)
> (SunOS 5.8) ready,
> Then I use      aftp.setRemoteFile("/opt");
>            aftp.setAction(Ftp.a_ListDirectoryLong);

>   to show the files of the directory,
>   but the first connection to the server seems to be lost, and the second
> connection to the server is established(netflow FTP server (SunOS 5.8)
> ready), then the message (1530 Please login with USER and PASS) is shown
> and the excepion message is (FTP protocol error. 530 Please login with USER
> and PASS)


>   Would you please tell me how to fix this problem?
>   My Jbuilder version is Jbuilder 5
>   Thank you very much!



> The following lines are used to connect to the server, and it seems to be
> fine
>         aftp.setPassword(pwd);
>         aftp.setRemoteHost(hostname);
>         aftp.setTransferMode(Ftp.tm_ASCII);
>         aftp.setUser(uid);
>         aftp.setLocalFile(datadir);//����Ŀ�ĵ�ַ


>         aftp.setAction(Ftp.a_Logon);


>         /*
>         System.out.println("before cd /opt");
>       aftp.setRemotePath("/opt");
>         System.out.println("after cd /opt");
> */

>         } catch(Exception e){
>               System.out.println("���ӷ�������:"+hostname);
>               return false;}

>         System.out.println("���ӵ�������:"+hostname);

First, verify that your workstation (or whatever machine is running the
JVM which is executing this code) is itself able to ftp from that ftp server.
FTP servers can be configured to reject connections from all but selected
machines, or from users whose workstations aren't named in DNS properly.
(For instance, on my ISP, there is a long pause between the "Connection 
accepted" from the ftp server and the "Username:" prompt.  It's doing a
reverse DNS lookup to ensure my hostname and ip address aren't being
spoofed.)

Second, verify that the host really understands the strings you've assigned
to the username/password fields.  I'm not real familiar with internationalized
Solaris, and I'm wondering if Java is passing in a unicode string for  your
username using a encoding than the server is expecting.  IE does the server
expect USASCII for the username but Java is sending it something like BIG5?
That's just a wild guess on my part.

I've never used this particular component from IP*Works.  Have you checked
the online help for details?

-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Guidelines: http://www.borland.com/newsgroups/guide.html
Only posts which violate the rules in guide.html are subject to cancelation.
Technical Details
Message-ID: <3b7bc2a8_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!lsanca1-snf1!news.gtei.net!enterprise!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail
References: <3b7b939b_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,d2d6351afe92496d
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-08-16 06:03:51 PST
Message-ID: <3b7bc2a8_2@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: How to use ipworks.ftp to show list of remote files
Newsgroups: borland.public.jbuilder.java.api
References: <3b7b939b_2@dnews>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 209.46.41.66
Date: 16 Aug 2001 05:55:05 -0700
X-Trace: dnews 997966505 209.46.41.66 (16 Aug 2001 05:55:05 -0700)
Lines: 69
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!lsanca1-snf1!news.gtei.net!enterprise!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail