ajijacobm 0 Light Poster

hi,
i have problems in accessing file through ftp from other computer..
i have a code, but it works fine in one computer... but i need to access a file stored in another computer connected through LAN.

try {
            URL url = new URL("ftp://PROJECT:123456@192.168.1.117:21/images/1.jpg;type=i");
            URLConnection con = url.openConnection();
            BufferedInputStream in = new BufferedInputStream(con.getInputStream());
            File a = new File("temp//");
            boolean isdirectory = a.mkdirs();
            FileOutputStream out = new FileOutputStream("temp//Ghostrecon.jpg");
            int i = 0;
            byte[] bytesIn = new byte[1024];
            while ((i = in.read(bytesIn)) >= 0) {
                out.write(bytesIn, 0, i);
            }
            out.close();
            in.close();
        } catch (Exception e) {
            System.out.println("Exception in connection!"+e.getMessage());
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.