Results 1 to 1 of 1
- 11-06-2009, 09:58 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 50
- Rep Power
- 0
error in file transfer from pc to microcontroller
dear sir,
i am written ftp connection with my microcontroller.my microcontroller ip is
192.168.2.20.i have written code,but not able to transfer file from pc to micro
controller.any help could be useful
this my code
try {
// TODO add your handling code here:
FTPClient client = new FTPClient();
FileInputStream fis = null;
try {
client.connect("192.168.2.20");
System.out.println("connected to sc23 microcontroller");
} catch (SocketException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
try {
client.login("ftp", "ftp");
System.out.println("connection sucess");
} catch (IOException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
String filename = filetext.getText();
try {
fis = new FileInputStream(filename);
} catch (FileNotFoundException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
try {
client.storeFile(filename, fis);
System.out.println("file upload sucess");
} catch (IOException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
client.logout();
try {
fis.close();
} catch (IOException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
} catch (IOException ex) {
Logger.getLogger(upload.class.getName()).log(Level .SEVERE, null, ex);
}
thank u
santhosh babu
Similar Threads
-
file transfer
By prashant in forum NetworkingReplies: 3Last Post: 12-10-2009, 06:46 AM -
Regarding File Transfer in TCP/IP
By manabendra in forum NetworkingReplies: 2Last Post: 08-07-2009, 07:51 AM -
tcp file transfer
By ddj in forum NetworkingReplies: 2Last Post: 03-20-2009, 02:10 PM -
Applet > servlet file transfer
By milkman128 in forum Java AppletsReplies: 1Last Post: 11-15-2008, 03:21 PM -
Java File Transfer
By lks0912 in forum Advanced JavaReplies: 0Last Post: 10-23-2008, 12:53 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks