Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3391560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:49:00+00:00 2026-05-18T03:49:00+00:00

Greetings folks. I have this weird problem. In the project I’m working on now,

  • 0

Greetings folks.

I have this weird problem. In the project I’m working on now, I need to upload a file to a FTP site. I have written many programs that do this before and they have worked just fine. But this particular site is giving me trouble. When I try to upload the file from the program, I get this to be specific:

java.net.UnknownHostException: ftp://site.com

However when I try to connect to the same site from within a browser (Chrome, IE) or from windows explorer, I’m able to find the site and login just fine. I tired posting a picture, but I was prevented from doing so as I’m a newbie.

So I’m stumped now. If I could not connect from windows, then I can assume it is a FTP server issue. This happens to me only from the Java program. And I also know that my code works as I have used in numerous occasions before. Here is the code I use:


public void uploadFile(String fileName) throws Exception {
        FileTransferClient ftpClient = null;

        try {
            ftpClient = new FileTransferClient();
            ftpClient.setRemoteHost(gv.ftpHost);
            ftpClient.setRemotePort(21);
            ftpClient.setUserName(gv.ftpUserName);
            ftpClient.setPassword(gv.ftpPassword);
            ftpClient.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);
            ftpClient.connect();

            ftpClient.uploadFile(gv.irp + fileName, fileName, WriteMode.OVERWRITE);
        }
        catch (Exception e) {
            throw new Exception("Error occured in uploadFile()\n" + e);
        }
        finally {
            if (ftpClient != null) {
                if (ftpClient.isConnected()) {
                    ftpClient.disconnect();
                }
                ftpClient = null;
            }
        }
    }

I use the edtFTPj library. My environment is Eclipse Helios (32 bit) on Java 1.6 (32 bit) running from a Windows 7 64 bit machine.

Any insight on resolving this will be greatly appreciated. Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:49:01+00:00Added an answer on May 18, 2026 at 3:49 am

    The message

    java.net.UnknownHostException: ftp://site.com

    suggests quite strongly that you’re trying to open a connection to a host named “ftp://site.com“, which is unfortunately a url rather than a host name and is thus not found.

    Try changing your code so that it connects to “site.com”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings folks! I'm running into a problem with WPF databinding that I hope you
Greetings, I'm working on a game project that uses a 3D variant of hexagonal
Greetings I may have imagined this but does anyone know if Last.fm previously used
Greetings, I have a view based application project where I have created an NSObject
Greetings , I am a new developer in BlackBerry Application. I have been working
Greetings, I'm using https://github.com/blueimp/jQuery-File-Upload (downloaded the version as of 5/21/2011) along with ASP.NET MVC3.
Greetings, I need a way (either via C# or in a .bat file) to
Greetings fellow enthusiasts! I am working on a project and I am utilizing python
Greetings P4 folks, I am trying to understand the P4 describe -ds output. I
Greetings, using VS2008 and VisualSVN and seems the VisualSVN folks are religious about updating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.