uploading video through ftp using
<p>In my application I want to upload video using ftp. I included <code>apache.commons.net</code> library in my application. When I am running the code it shows <code>04-28 14:56:05.229: ERROR/dalvikvm(739): Could not find class 'org.apache.commons.net.ftp.FTPClient', referenced from method net.jeema.hwdvideoshare.NewVideoActivity$loadVideo.doInBackground</code>.</p>

<p>How to solve this problem? I am using the below code:</p>

<pre><code>protected Void doInBackground(Void... arg0) {
        String hostName = "ftp.host.net";
        String username = "test";
        String password = "test";
        String location = selectedPath;


        InputStream in = null;
        try {
            FTPClient ftp = new FTPClient();
            ftp.connect(hostName);
            ftp.login(username, password);

            ftp.setFileType(FTP.BINARY_FILE_TYPE);

            ftp.changeWorkingDirectory("/uploads");

            int reply = ftp.getReplyCode();
            System.out.println("Received Reply from FTP Connection:" + reply);

            if (FTPReply.isPositiveCompletion(reply)) {
                System.out.println("Connected Success");
            }

            File f1 = new File(location);
            in = new FileInputStream(f1);

            ftp.storeFile(fname, in);

            System.out.println("SUCCESS");

            ftp.logout();
            ftp.disconnect();
        } catch (Exception e) {
            e.printStackTrace();
        }
</code></pre>
