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 8149461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:51:25+00:00 2026-06-06T14:51:25+00:00

I have a ftp client that allows users to upload files. I want determine

  • 0

I have a ftp client that allows users to upload files. I want determine which user/host/… uploaded that file.All people using the same username to upload file.the only difference is that they use different computer.

Is there any way I can track which user uploaded that file?

public static void uploadFileToServerViaSunFtp(final String source,final JPanel panel, final JTextArea textArea)
{
    SwingWorker uploadWorker = new  SwingWorker<Boolean,String>()
    {
        @Override
        protected Boolean doInBackground() throws Exception
        {
            publish("File "+FilenameUtils.getName(source).concat(" starts uploading on ") + String.valueOf(Calendar.getInstance().getTime() + "\n"));
            boolean success = false;
            FtpClient client;
            try
            {
                client = new FtpClient(server.getFtpServer());
                client.login(server.getUsername(), server.getPassword());
                client.cd("PC");
                client.binary();
                int BUFFER_SIZE = 10240;
                byte[] buffer = new byte[BUFFER_SIZE];

                File f = new File(source);
                FileInputStream in = new FileInputStream(source);
                // *** If uploading take long time, progress bar will show up ***
                InputStream inputStream = new BufferedInputStream(
                        new ProgressMonitorInputStream(panel, "Uploading " + f.getName(), in));
                OutputStream out = client.put(f.getName());
                while (true) {
                    int bytes = inputStream.read(buffer);
                    if (bytes < 0)
                        break;
                    out.write(buffer, 0, bytes);
                }
                out.close();
                in.close();
                inputStream.close();
                client.closeServer();
                success = true;
            }
            catch (IOException e)
            {
                OeExceptionDialog.show(e);
            }
            return success;
        }

        @Override
        protected void done()
        {
            super.done();
            try {
                if(get())
                    textArea.append("File "+FilenameUtils.getName(source).concat(" Uploaded successfully.\n"));
        }
    };
    uploadWorker.execute();
}
  • 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-06-06T14:51:26+00:00Added an answer on June 6, 2026 at 2:51 pm

    Files stored on an FTP server have owners (oid) and groups (gid).

    The purpose of logging into an FTP server is to have you both authenticated and authorized. Therefore you should have different users as in ‘different usernames’ for each user who will be uploading the file.

    It makes no sense to have the same username used by all your users, as this will make it impossible to make a distinction.

    Checking the IP address is complete non-sense. The reason I am saying this is that anyone can hijack an IP address, if they’re on your local network. There’s little validation here and you can’t trust your local DNS to do the job for you.

    Simply use different usernames.

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

Sidebar

Related Questions

I have developed a web based application which allows a client/user to upload a
I have an FTP client class which returns InputStream pointing the file. I would
I'm looking for a FTP client that I can use to upload new files
When I want to upload some files that I have tested with MAMP on
My client does not want to have ftp on the production box (understandable). We
I am able to have my application upload files via FTP using the FTPClient
I have response stream from a ftp web request that returns binary file. I
I have to upload a file to an FTP server. The filename contains special
We have some files on our website that users of our software can download.
We have a C# application that connects to a FTP server, downloads some files,

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.