Aalok Pandit

Greenhorn
+ Follow
since Sep 26, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aalok Pandit

Hi Mathias

Not sure if this helps you, but I was facing a similar problem.

The error I was getting was :
"Host attempting data connection is not same as server" or something like that.

I have posted the solution in my topic
FTP connection to a Proxy

hope this solves your problem
Hi Ravi
I'm not sure if I understand your query and even if this reply is going to help.

I guess you want the timestamps of files on a remote server.
If you are allowed FTP connection on the server, you can use the ls command to get the file listing and then use text processing to extract the fifth column i.e. the timestamp.

If you use a Java API for FTP e.g. commons-net by Jakarta, you can directly get the timestamp of the files on the remote server.
All

The settings suggested in the link do not help(at least did not help in my case).

How I solved it(Hope it helps someone else):
I looked into the source code of FTPClient and browsed to the code which was throwing the error. There I realised that a verification which generally passes, was failing on the proxy server.

When we instantiate a FTPClient object, a boolean variable remoteVerificationEnabled is set to true by default. This variable is used while doing a connection verification, which fails in case of proxy servers.

So after the instantiation of FTPClient, we need to set the variable to false by calling the setter method.
eg:


Please correct me if I am wrong.
Joe: Thanks for the info. But my organisation wants it to be developed in-house.

Carl: Thanks. Setting up the ftp.proxyHost and ftp.proxyPort properties solved my issue.

Thanks all for your time.
Alfonso : I had a cursory look at the code, and I don't think I can use that code.

Joe : Thanks for the info. I tried to post on the commons community but couldn't find a suitable forum to post it in. I will definitely try using the URL aproach. Can I also perform a directory listing and rename operations from it? It would also be helpful if you could provide some pointers towards achieving secure ftp using a similar approach as my organisation might have some licensing issues if I use third party API's
try this link. it might be helpful.
17 years ago
gaurav,

as already pointed out, the problem is of the character ':' which is not acceptable in windows. the code works fine on Unix.

also, you might want to change the line

boolean bool = file1.renameTo(new File("D:\\project\\vision\\files"+"\\"+tmstamp.toString));


to
otherwise you may end up giving the same name to all files.

[ July 18, 2006: Message edited by: Aalok Pandit ]
[ July 18, 2006: Message edited by: Aalok Pandit ]
17 years ago
brijesh

this page mentions that the code will work if you install JCE along with jdk 1.3, which is available on sun's site.
i am also using jakarta commons-net 1.4.1 API

i use the listFiles() method to check whether the file to be transfered exists on the server or not, but my code is working fine.

the issue might be regarding the jakarta-oro classes as mentioned earlier.
17 years ago
hey guys

no one ready to help me out!!!
please let me know if a similar issue has already been addressed here. i couldn't find a similar problem anywhere else, that's why i posted it here.
45.31 wpm
190.29 cpm


is that good or bad???
17 years ago
hi

the mic-in socket is a mono-socket, however the output of a tv box or a radio set is essentially stereo.

you'll need a stereo to mono converter before you can plug your tv sound into laptop.


hope this helps!!!
17 years ago
I'm sorry franco, but I didn't get what you want to say.
ya, even i had a similar application where i had to store data provided in a GUI and JTable is what i used.
17 years ago
Hi
My application requires get, put and rename operations to be performed through Java.

I am using commons-net API by jakarta. The code is able to connect to most of the servers, but in case of a specific proxy server, the connection fails. The IP address of the said server keeps on changing between two values. When the request is routed to one of these IP's the code completes successfully, but fails for the other IP.

Interestingly, if I try FTP through command prompt, or PERL, it always completes. Only Java is not able to connect.

Another thing is that this application also requires SFTP support, so I tried JSch API from JCraft. This also is able to connect to all the servers except the above mentioned proxy server. But in this case, the connection always fails, irrespective of the IP of the proxy.

Please help me out as I've been stuck at this problem for weeks now, also I couldn't find a similar problem anywhere else.