Results 1 to 7 of 7
- 02-07-2011, 01:19 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
- 02-07-2011, 01:26 PM #2
Java FTP Examples Source Code
http://www.ajaxapp.com/2009/02/21/a-...ad-and-upload/
In google is much information about it.Skype: petrarsentev
http://TrackStudio.com
- 02-07-2011, 01:34 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-07-2011, 06:31 PM #4
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
Help
tell me also how to transfer file...:(
- 02-07-2011, 06:42 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 02-07-2011, 07:04 PM #6
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
- 02-08-2011, 07:08 AM #7
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
ftp
this is a small program
the program is as follows
server program///
import java.io.*;
import java.net.*;
public lass ftps
{
public static void main(String ar[])
{
Socket s;
ServerSocket server;
FileInputStream fis;
BufferedReader br;
PrintWriter pw;
String filename;
int c;
try
{
server=new ServerSocket(1111);
System.out.println("server is waiting for the connection");
s=server.accept();
System.out.println("connection established");
br=new BufferedReader(new InputStreamReader(s.getInputStream()));
pw=new PrintWriter(s.getOutputStream());
filename=br.readLine();
fis=new FileInputStream(filename);
while((c=fis.read())!=-1)
{
pw.print((char)c);
pw.flush();
}
System.out.println("file copied");
s.close();
}
catch(Exception e)
{
System.out.println(e)
}
}
}
client program
import java.net.*;
import java.io.*;
public class cli
{
public static void main(String ar[])
{
Socket s;
BufferedReader br;
PrintWriter pw;
String spath,dpath;
FileOutputStream fos;
int c;
try
{
s=new Socket("localhost",1111);
in=new BufferedReader(new InputStreamReader(System.in));
br=new BufferedReader(new InputStreamReader(s.getInputStream()));
pw=new PrintWriter(s.getOutputStream());
System.out.println("enter the source");
spath=in.readLine();
System.out.println("enter the destination");
dpath=in.readLine();
fos=new FileOuptustream(dpath);
while((c=br.read())!=-1)
{
fos.write();
fos.flush();
}
System.out.println("file reached");
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Similar Threads
-
File Transfer using java.IO
By cheng in forum New To JavaReplies: 0Last Post: 12-14-2009, 04:42 AM -
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 -
data loss in the secure file transfer using java
By antony75 in forum NetworkingReplies: 4Last Post: 02-09-2009, 06:56 AM -
Java File Transfer
By lks0912 in forum Advanced JavaReplies: 0Last Post: 10-23-2008, 12:53 PM


LinkBack URL
About LinkBacks


Bookmarks