FTP client & checking

Dear Friends
I have query, I want to write java code to check zip file present on ftp site & if present check whether that zip file is proper zip or currupted zip. pls guide me thanks

Hi,
That can't be done from the client side. You can check if the file is there, and you can get the size of the file. But you have to download if you want to verify it. But you will not be able to tell why a check failed if it fails. Was it because the remote file is corrupt, or because it got corrupt during download?
/Kaj

Similar Messages

  • How to get the FTP clients to work?

    This is something that (to me at least) should be trivial but I just can't
    get it to work at all.
    How do you get an FTP client to work?
    I've tried several GUI clients as well as the terminal FTP command and they
    all seem to get stuck entering passive mode - according to the log entries
    they send the command.... And then nothing or a timeout, the following is
    from the terminal FTP command:
    Titania:~ susan$ ftp ftp.apple.com
    Trying 17.254.16.11...
    Connected to ftp.apple.com.
    220 17.254.16.11 FTP server ready
    Name (ftp.apple.com:susan): anonymous
    331 Anonymous login ok, send your complete email address as your password.
    Password:
    230 Anonymous access granted, restrictions apply.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> ls
    501 EPSV: Operation not permitted
    227 Entering Passive Mode (17,254,16,11,223,157).
    200 PORT command successful
    421 Service not available, remote server timed out. Connection closed
    ftp>
    In my System Preferences -> Network panel in the Proxies tab, I have the
    "use Passive FTP mode (PASV) checked.
    I also have checked the FTP firewall option (but I think that is only if I'm
    acting as an FTP server).
    I am connected to the internet via a Netgear wireless router.
    I also have an old Windows laptop that also uses the same wireless router
    and it can FTP quite happily!!!!!
    Any suggestions would be gratefully received.
    Susan

    ejn - thanks for your continued assistance.
    I've tried turning the firewall off but this does not appear to make any difference(*). Also, I have Parallels installed and I'm sharing the internet connection with this (even though Parallels itself is not currently running). Turning this sharing off doesn't seem to change anything either.
    I have noticed some entries in the ifpw.log file that coincide with some of the ftp actions. Given the following terminal session:
    Titania:~ susan$ ftp ftp.apple.com
    Trying 17.254.16.10...
    Connected to ftp.apple.com.
    220 17.254.16.10 FTP server ready
    Name (ftp.apple.com:susan): anonymous
    331 Anonymous login ok, send your complete email address as your password.
    Password:
    230 Anonymous access granted, restrictions apply.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> ls
    501 EPSV: Operation not permitted
    227 Entering Passive Mode (17,254,16,10,245,46).
    200 PORT command successful
    421 Service not available, remote server timed out. Connection closed
    ftp>
    at the time the "200 PORT command successful" is displayed, the ifpw log starts showing:
    Sep 5 09:11:21 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:24 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:27 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:30 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:33 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:36 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    Sep 5 09:11:42 Titania ipfw: 12190 Deny TCP 17.254.16.10:20 192.168.0.5:49162 in via en1
    which makes sense as the system tries to go for an active transfer.
    (*) Actually, while I've been writing this, I've been playing on the terminal as well. I've found the combination of:
    1) turning off the firewall
    2) starting ftp
    3) issuing the 'passive' command to turn off passive mode
    4) issuing 'ls' etc. works
    Looks like I've not been waiting long enough for the ftp client to get sick of trying the passive transfer and switching to an active one with the firewakk turned off!
    Still doesn't answer the question - why does passive mode not work?
    Susan

  • Alternative FTP client app on mac

    Hi guys
    Can you recommend on a good reliable FTP client for Mac? I would like the FTP client to upload files automatically upon saving the file which is a great feature of Espresso but unfortunately I find Espresso's FTP to be a pain to work with.
    Thanks

    If you check the following article, you will get a list of FTP clients recommended by Business Catalyst
    http://kb.worldsecuresystems.com/kb/connecting-your-site-using-ftp.html#main_Understanding _FTP_clients
    Here is the List of FTP clients for MAC given in the Article:
    http://www.cuteftp.com/trial.aspx (Cute FTP)
    http://filezilla-project.org/download.php (File Zilla)
    http://cyberduck.ch/ (Cyberduck)
    http://mac.sofotex.com/download-130101.html (SimpleFTP)
    Hope this helps.

  • Impossible Upload files with Filezilla FTP Client after upgrade win8 to win8.1

    Hi
    Things were working fine with win 8 but, after Upgrade to win 8.1 is not possible upload files with Filezilla  FTP Client.
    is there anyone facing same problem?
    thanks in advance for any answer to help me solve this issue 
    Regards 
    TC

    Hi,
    Please Change your transfer settings in site manager from either default or passive to active it to see what's going on.
    Also, check IE compatibility mode.
    In addition, I suggest you install all latest updates for Windows since these updates will improve and fix some known issues.
    Kate Li
    TechNet Community Support

  • Using XI as a ftp client

    Hello,
    I would like to ask that can I use XI 3.0 as a ftp client? I would like to explain the scenerio, below;
    We are storing EDI documents on a file server. So, we would like to download those files into a directory located on XI machine, as a first step. Then upload an them into an HP-UX system. Notice that we don't want to change the content of files and its name either, at the destination location. Can we do this? Thank you.
    Regards,
    Orkun Gedik

    Hi,
    These are a few things that you need to take care if your using FTP.
    - make sure that FTP server is installed in the host system or the system from which you are picking the file.
    - Provide the correct ip address.
    - Check the username and password provided for authentication.
    - You need to place the file in the root folder that you mention while configuring the FTP server.
    - The source folder name will be, ‘/rootfoldername’ (don’t forget the slash and also the folder name should be the root folder name that u have mentioned while configuring the FTP server).
    Also check the permissions of the folder where the file is being generated by XI.
    I Guess you should first see if the file is being picked... for that do the following.
    While configuring your Sender File Adapter, let the mode be DELETE. This way, we will know if the file is being picked by the File adapter. The file will be deleted and you can be sure that it has been picked up.
    In your runtime workbench home, there will be a tab, Component Monitoring, click on it. Select status as all, and click on display. The components will be displayed on ur screen. In that, under Integration Server, there will be a link for Adapter Engine. Click on it. Now, scroll down, and u will see a link to adapter monitoring, there under FILE ADAPTER see the log of the file adapter
    and also, you can see the flow of your message in the integration engine in SXMB_MONI.
    Regards,
    Abhy

  • Where do I find the default FTP client?

    I'd like to set the Finder back to being my default FTP client, however when I hit Go -> Connect to Server and type anything with ftp:// in front, it opens my Firefox. How do I set it to open the Finder instead?
    I know I can set the default browser in Safari but I can't see anywhere to set the default FTP.
    Thanks

    If I rebuild my launch services database won't I need to manually set all the file associations again? After all, this isn't accidental, I must have set Firefox to handle my FTP for some bizarre reason. I haven't tested whether thats true or not because I did check out the home/Library/Preferences/com.apple.launchservices.plist like you suggested.
    In there, having opened it up in PropertyList editor (knew I downloaded that for something! I found an entry LSHandlerURLScheme with the value ftp and above that LSHandlerRoleAll with the value org.mozilla.firefox.
    I checked on another machine where the Finder did open and saw the value it had in the same place was com.apple.finder so I put that in, hit save and off it goes. Perfect!
    There were other entries for sftp and others so I edited that as well.
    So thank you very much, that's exactly what I was looking for. Not exactly simple though!

  • FTP issues with DW CS5 that don't happen with an FTP client or MX

    On a mac OS 10.6.4, using DW CS5 to login to an existing site using FTP.  It connects fine but then all I get is a .txt file with a note indicating that FTP can't be used when Frontpage extensions are activated. I checked on my webserver status (at 1&1) and they aren't active. So I tried with an FTP client like cyberduck and all the files are there. Likewise, I used an old version of DW (think it was MX vintage 2002) and all the files show up server side just fine - (I just can't download the site due to version incompatibility so DW rejects it). Does anyone know what could be going wrong here? As far as I know the site was created by DWMX (think that was 2004). Thanks

    I assumed that if I was using an older version of DW then it wouldn't download pages authored with a later version but I guess it's just code...
    Yep - it's just text files containing HTML, CSS, javascript, and links to other files.
    When using FTP through DWMX I see the server side of the site
    You can see the files listed on the remote server?
    I can send you the details if you wish, I'm not sure what's going on here...
    You can try sending to forums at domain dot com (replace 'domain' with 'great-web-sights')

  • FTP client problem

    Hello.
    I'm trying to create a ftp client running on adobe AIR in flex builder.
    The fcommand socket work, but when i create the data socket, the command socket still work but if I tipe a new command, like PWD, i do not receive answer. Does someone know why?
    I don't see error events widh IO_ERROR or SECURITY error, so I suppose no error occours.
    here is the code
    import flash.events.Event;
                   import flash.events.IOErrorEvent;
                   import flash.events.MouseEvent;
                   import flash.events.ProgressEvent;
                   import flash.events.SecurityErrorEvent;
                   import flash.net.Socket;
                   protected var s:Socket;               // socket comandi
                   protected var s_dati:Socket;
                   protected function btn_connetti_clickHandler(event:MouseEvent):void
                        var aspetta:Boolean = true;
                        function connesso(evt:Event):void     {
                             //label_stato.text += "Connesso!";
                             // ora che la socket è connessa invia user e password
                             s.writeUTFBytes("USER **\n");
                             s.writeUTFBytes("PASS **\n");
                             // apre un canale dati passivo
                             //s.writeUTFBytes("RETR index.php\n");
                             s.writeUTFBytes("PASV\n");
                        function connessoDati(evt:Event):void     {
                             label_stato.text += "Socket dati connessa!";
                             if(s.connected)
                                  s.writeUTFBytes("\nLIST\n\n");     THIS COMMAND DOES NOT RETURN ANY OUTPUT
                             else
                                  label_stato.text = "CONNESSIONE PERSA\n";
                        function riceviDati(evt:ProgressEvent):void     {
                             label_stato.text += "DATA -> "+ s_dati.readUTFBytes(evt.bytesLoaded);
                        function erroreSicurezza(evt:SecurityErrorEvent):void     {
                             label_stato.text = "Errore nella sicurezza "+evt.text;
                        function chudi(evt:Event):void     {
                             label_stato.text = "Chiusura connessione";
                        function progresso(evt:ProgressEvent):void     {
                             var str:String = s.readUTFBytes(evt.bytesLoaded);
                             label_stato.text += str;
                             var arrS:Array = str.split("\n");
                             for (var i:int = 0; i<arrS.length; i++)     {
                                  //if(arrS[i])
                                  //label_stato.text += "->"+arrS[i]+"\n";
                                  var tmps:String = arrS[i].toString();
                                  if(tmps.substr(0,3) == "227")     {
                                       //label_stato.text += tmps+"\n";
                                       var IPport:String = tmps.substring( tmps.indexOf("("), tmps.indexOf(")") );
                                       var numeri:Array = IPport.split(",");
                                       var porta:Number = 0;     // numero di porta;
                                       var LSB:Number = numeri[numeri.length-1];
                                       var MSB:Number = numeri[numeri.length-2];
                                       label_stato.text += "Connessione passiva\n" + MSB+ " " + LSB+"\n";
                                       porta = (MSB *256) + LSB;
                                       s_dati.connect("ftp.******.it", porta);
                                       s.writeUTFBytes("RETR index.php\n");
                        function erroreIO(evt:IOErrorEvent):void     {
                             label_stato.text += "\nERRORE " + evt.text;
                        // crea la socket
                        s = new Socket();
                        s_dati = new Socket();
                        // gestione eventi
                        s.addEventListener(Event.CONNECT, connesso);
                        s.addEventListener(ProgressEvent.SOCKET_DATA, progresso);
                        s.addEventListener(IOErrorEvent.IO_ERROR, erroreIO);
                        s.addEventListener(SecurityErrorEvent.SECURITY_ERROR, erroreSicurezza);
                        s.addEventListener(Event.CLOSE, chudi);
                        s_dati.addEventListener(Event.CONNECT, connessoDati);
                        s_dati.addEventListener(ProgressEvent.SOCKET_DATA, riceviDati);
                        s_dati.addEventListener(IOErrorEvent.IO_ERROR, erroreIO);
                        s_dati.addEventListener(SecurityErrorEvent.SECURITY_ERROR, erroreSicurezza);
                        s_dati.addEventListener(Event.CLOSE, chudi);
                        s.connect("ftp.****.it", 21);
                   protected function btn_dati_clickHandler(event:MouseEvent):void
                        label_stato.text += tx_comandi.text+"\n";
                        s.writeUTFBytes(tx_comandi+"\n");

    Hi,
    I'm having the same problem, I fight with this for last week and nothing, I cant find a working example of socket connection on the internet, local work ok, but on server i get one of all of this errors all time:
    SecurityError–>Error #2048,
    *** Security Sandbox Violation ***,
    Warning: [strict] Ignoring policy file at xmlsocket://xxxxxxx.com:21 due to incorrect syntax.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
    I read and try all adobe answers for the problem: Security.loadPolicyFile; crossdomain.xml...
    Updates, others webrowsers...
    I check all webpages about this problem and nothing.
    Follow some lines I try for last week:
    Security.loadPolicyFile("http://www.xxxxx.com:80");    or
    Security.loadPolicyFile("http://www.xxxxx.com/crossdomain.xml");
    s = new Socket("xxxxx.com",21)
    s = new Socket("ftp.xxxxx.com",21)  <<< this one dont work even local
    It worked fine from my local machine. But when I deployed it on my server...
    Is this some kind of bug?
    Anyone know a working example that i can check?

  • WRT54G2 and ftp client

    Hello there!
    Find strange problem working with WRT54G2 (firmware 1.0.04 - latest) 
    I try to connect to ftp server and very often get disconnects - see example of log below:
    2009-09-20 23:37:50 3292 0 Status DNS request *******
    2009-09-20 23:37:50 3292 0 Status Connection with *********
    2009-09-20 23:37:50 3292 0 Status Connection established
    2009-09-20 23:37:51 3292 0 Reply: 220 Welcome to Hosting Telesystems ftp service.
    2009-09-20 23:37:51 3292 0 Command: USER ********
    2009-09-20 23:37:51 3292 0 Reply: 331 Please specify the password.
    2009-09-20 23:37:51 3292 0 Command: PASS ********
    2009-09-20 23:37:51 3292 0 Reply: 230 Login successful.
    2009-09-20 23:37:51 3292 0 Command: SYST
    2009-09-20 23:37:51 3292 0 Reply: 215 UNIX Type: L8
    2009-09-20 23:37:51 3292 0 Command: FEAT
    2009-09-20 23:37:51 3292 0 Reply: 211-Features:
    2009-09-20 23:37:51 3292 0 Reply: EPRT
    2009-09-20 23:37:51 3292 0 Reply: EPSV
    2009-09-20 23:37:51 3292 0 Reply: MDTM
    2009-09-20 23:37:51 3292 0 Reply: PASV
    2009-09-20 23:37:51 3292 0 Reply: REST STREAM
    2009-09-20 23:37:51 3292 0 Reply: SIZE
    2009-09-20 23:37:51 3292 0 Reply: TVFS
    2009-09-20 23:37:51 3292 0 Reply: UTF8
    2009-09-20 23:37:51 3292 0 Reply: 211 End
    2009-09-20 23:37:51 3292 0 Command: OPTS UTF8 ON
    2009-09-20 23:37:51 3292 0 Reply: 200 Always in UTF8 mode.
    2009-09-20 23:37:51 3292 0 Status Connection established
    2009-09-20 23:37:51 3292 0 Status getting list of directories
    2009-09-20 23:37:51 3292 0 Command: PWD
    2009-09-20 23:37:51 3292 0 Reply: 257 "/"
    2009-09-20 23:37:51 3292 0 Command: TYPE I
    2009-09-20 23:37:51 3292 0 Reply: 200 Switching to Binary mode.
    2009-09-20 23:37:51 3292 0 Command: PASV
    2009-09-20 23:37:54 3292 0 Ошибка:  ECONNABORTED - Connection aborted 
    Same for all ftp servers i'm trying to access (even with ftp-server of my provider just next hop from router). Also i tried different ftp clients. Tracert doesn't indicate any troubles on the way.
    But most interesting that after several tries it's connecting successfully. And after 10-20 tries i could even upload/download file to server. So it does not completely blocked somewhere, it works but very not stable.
    I tried same client with Linksys WAG54GS (DSL modem) just to check could it be problem with my laptop and it works very good, no problems at all. 
    Looks like my WRT54G2 doesn't work very well with ftp. May be NAT problem or something else? Any ideas how this could be fixed?
    Many thanks in advance,
    mitko

    Well, try to reflash the firmware for the router and forward the port 21 on the router for ip address of computer on which you are trying to access the FTP.

  • I have a mac OS X 10.4.11 and have created a website in iweb08  ... in order to get it to my host site for it to go live I am having difficulty finding a ftp client to get me there. Can anyone suggest what I should do?

    I have a mac OS X 10.4.11 and have created a website in iweb08  ... in order to get it to my host site for it to go live I am having difficulty finding a ftp client to get me there. Can anyone suggest what I should do?

    Check if any of the below have an older version by contacting the author for your 10.4.11:
    http://www.rbrowser.com/
    http://rsug.itd.umich.edu/software/fugu
    http://cyberduck.io/
    http://panic.com/transmit/
    http://fetchsoftworks.com/
    Or use Applications -> Utilities -> Terminal to do command line FTP:
    http://www.dummies.com/how-to/content/how-to-use-ftp-from-terminal-to-transfer-m ac-files.navId-400509.html
    Upgrading to 10.6.8 should still give you mostly the same compatibility as 10.4.11. Upgrading to 10.7 and above won't.

  • FTP-Clients compatible with OES-PureFTPd - remote-home-feature

    Hi folks,
    I'm searching for Windows FTP Clients which are compatible with OES-FTP-Service (OES11SP1) and which support the remote-home feature. Until today I have only found filezilla (only in cygwin-Servertype configuration) which can handle a remote syntax like \\edir-servername to switch to another fileserver in the tree without any problems.
    Do you know any other ftp-clients for windows which support that remote-feature?
    Cheers, k.

    k-i-r,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://www.novell.com/support and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Forums Team
    http://forums.novell.com

  • FTP client which supports NTLM through WSA

    We are looking into a FTP Client which supports NTLM in combination with
    our WSA proxy servers.
    With IE or Firefox browser it works fine.
    Currently i.am testing Filzilla version 3.3.4.1 "http://filezilla-project.org" but i can't
    seem to get it to work.
    On the internet there is not much information available.
    Anyone have expierence with FTP clients?

    Have contacted support and they gave me the following information:
    You should be able to use the Filezilla FTP client along with NTLM authentication. The settings for Filezilla would depend on
    the below factors & settings:
    Using Native FTP Proxy on IronPort
    1)      Check the Native FTP port and authentication mechanism configured on IronPort under:
    a.       GUI --> Security Services --> FTP proxy
    b.      Check the Port and authentication format
    2)      Based on the authentication format, you would need to configure settings as the below knowledge-base article:
    a.       http://tinyurl.com/nvbt5r
    Using FTP over HTTP CONNECT in Filezilla
    1)      You can configure this in Filezilla under:
    a.       'Edit' --> 'Settings' --> Generic Proxy --> HTTP 1.1 Using CONNECT method
    2)      In this section you can specify the NTLM credentials  in the below section:
    a.       Proxy Username (DOMAIN\username) and Proxy password 
    So i tried the native ftp option with
    Ironport ftp port 8021 with checkpoint auth.
    In filezilla under FTP Proxy,
    Proxy host %ipaddress%:8021
    Proxy user %domain%\%userid%
    Proxy pas  **********
    Then i get following in Filezilla log:
    Status: Using proxy IPADDRESS:8021
    Status: Connecting to IPADDRESS:8021...
    Status: Connection established, waiting for welcome message...
    Response: 220 FTP Server message!!!
    Command: USER anonymous@domain\[email protected]: 331 User name okay, need password.
    Response
    Command: PASS ***************************
    Response: 530 Login denied
    Error: Critical error
    Error: Could not connect to server
    So i think the following part goes wrong:
    Command: USER anonymous@domain\[email protected]
    If i have the correct solution i wil post it here!

  • Getting pictures on a FTP client.

    If I only want to get seven pictures on a FTP client, is it really necessary to have a web site. Are there any other possibilities?

    jonesan wrote:
    Thanks again. After using your directions for connecting to the site, as in nr.8, I got  FTP information, to open a TCP/IP connection. How do I do that? In the FTP program I have filled out for host: ftpmysite.verizon.net.  For profile name I used WS_FTP32, is that correct?
    Yes that is correct.
    Here is an example of the correct settings for Core FTP LE.
    http://i45.tinypic.com/mmefxv.jpg
    Note: Do not use the user name anonymous (by having anonymous checked ) , use your real verizon user name.
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • Issue with vlc steaming through dolphin ftp client

    I am not sure if i should post this here or in the multimedia section excuse me if i am mistaken. I have been using archlinux in almost 4 weeks with gnome 3. I have installed kde today after removing gnome(pacman -Rscn gnome). I have a small home server running ftp server where i have some media files(.mkv). In gnome i usually used nautilus to access the ftp folder(sftp://servername.dyndns.org/srv/) and run vlc to stream the medias. Tried to do the same with kde dolphin with no luck.
    First i was not able to view the folder with dolphin. I researched abd found this thread with a solution:
    http://forum.kde.org/viewtopic.php?f=18 … 5&start=15
    Now i am able to access the folder, but can't stream any media using vlc.
    The following errors are from vlc:
    Your input can't be opened:
    VLC is unable to open the MRL.
    sftp://servername.dyndns.org/srv/filename.mkv
    Check the log for details.
    Going into tools->messages gives the followings:
    main error: open of
    sftp://servername.dyndns.org/srv/filename.mkv failed:(null)
    I suspect something is wrong the ftp client configuration in dolphin. This bug report also bothers me also :
    http://old.nabble.com/-Bug-274170--New% … 05158.html
    Other thing is that i am able to open the media files using other media players(dragon player, mplayer), but then the files are automatically downloaded into the local folder /var/tmp/kdecache-username/krun/filename.mkv. The media player then loads the file from there. Its the same if i open a text file in the server, edit it and save it. Its first downloaded to the /var/ folder then asked to upload back to the server when closed.
    Its my conclusion that the ftp client in dolphin does not work properly or KDE KIO works different then whatever is used in gnome/nautilus. I hope i have explained the issue as good as possible and would appreciate any help or lead to how to solve this.

    Thanks for your reply, after checking some ideas I found that to get the ftp to work I needed to use the internal IP 10.0.0.1 for it rather than the old normal IP like before the firewall(probably a very beginner error sorry for that). And I discovered the exact issue causing clients to not see their characters if not using Hamachi.
    Hamachi treats everyone join to the network as though they are local I believe, so when the server send character info via Hamachi it thinks it is sending the info locally and then Hamachi itself sends it out to the extrenal client, while tracing the data I found that the login process sends a 33 byte packet of data to the client via TCP from port 5051 out to the client on a rnadom port usually in the range of 40000-50000 telling the client to send a request to the other process to ask for the character information.
    Now for some reason I see when a client logs in through Hamachi that packet is sent correctly to their Hamachi IP and recived fine.(sent from 10.0.0.1:5051 to the Hamachi IP:40k-50k) but when a client tries to log in using a normal IP with Hamachi turned off, the log in process does send the 33 byte packet from 10.0.0.1:5051 to the client WAN IP through the usual port but the client never recieves this packet and as such doesn't not request the character information.
    So my guess is something on the 5505 is disallowing the log in process to send the data externally to the clients WAN IP's? Though this is very odd because it does allow the client to actually log in to the account and seems to recieve at least part of that information fine.
    If any help that might resolve this for me can be given I would very much appreciate it, this issue is limiting my client base and as such my income and business as a whole. Thank you in advance for any help given.

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

Maybe you are looking for

  • Error in time evaluation

    Dear All, time evaluation is throwing an error msg "No entry in table T001P for key" for only one employee in the time evaluation display log. Its happening in the initialization part in time evaluation. for example, If i run the time evaluation for

  • BP Search in ICWB in CRM 5.0

    Hello Experts We are using CRM for a customer who has some milions of business partners. The Business Partner search in IC WebClient is very slow and there are cases where the page gets time out.If we dont use exact search criterias the search is ter

  • Exchange 2007 Management shell issue: "There are multiple objects matching the identity "servername" Please specify a unique value"

    I thought this would be an easy answer to an issue I'm facing, but there's a problem executing the solution. I'm running Exchange 2007 in a clustered SCC configuration.  The clustered resource is called "DENBURYMAIL."  I want to give my account full

  • RBL exceptions

    Hi. We are using Iplanet 5.2 p2 on Solaris 8. We were using some RBL lists and everything was ok and the spam reduces like 90%. Now we have a problem, some servers are reported like spamers but we want to receive emails from them, and we want a speci

  • Member load error from EIS

    I'm loading data into essbase from eis. After member load following error is given EssbaseAPI: You have been logged out due to inactivity or explicitly by the administrator. When I try the same thing using user 'admin' it works fine. but the error is