ftp

how to make a ftp s/w in java

Page 1 of 1

3 Replies - 1173 Views - Last Post: 01 March 2009 - 04:59 PM Rate Topic: -----

#1 [email protected]   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-March 09

ftp

Post icon  Posted 01 March 2009 - 02:16 AM

how to make ftp s/w in java[code][font=Arial][size=5] :^:
Is This A Good Question/Topic? 0
  • +

Replies To: ftp

#2 ayman_mastermind   User is offline

  • human.setType("geek");
  • member icon

Reputation: 127
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: ftp

Posted 01 March 2009 - 03:11 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this: :code:

Thank you for helping us helping you
Was This Post Helpful? 0
  • +
  • -

#3 horace   User is offline

  • D.I.C Lover
  • member icon

Reputation: 768
  • View blog
  • Posts: 3,832
  • Joined: 25-October 06

Re: ftp

Posted 01 March 2009 - 08:02 AM

View Post[email protected], on 1 Mar, 2009 - 08:16 AM, said:

how to make ftp s/w in java[code][font=Arial][size=5] :^:

if you have not programmed TCP or UDP sockets read up on Java clients and servers
http://java.sun.com/...kets/index.html

then implement the FTP protocol
http://cr.yp.to/ftp.html
Was This Post Helpful? 0
  • +
  • -

#4 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: ftp

Posted 01 March 2009 - 04:59 PM

OK complicated topic
Here is I do it...
you will have to post some code for more help thow

		/* On tente d'ouvrir la connection sur le site FTP de pblinc */
		URLConnection urlc;
		try {
			URL url = new URL("ftp://"+ username+ ":"+ username + "@"+ host+ "/"+ targetFile+ ";type=i");
			urlc = url.openConnection();
		}
		catch (Exception e) {			// connection refusee
			urlc = null; 				// section 3.2.5 of RFC1738
			return;
		}

		
		// traduction du StringBuffer en bytes pour l'outputStream
		byte[] b = buf.toString().getBytes();
		try {
			OutputStream os = urlc.getOutputStream(); // To upload
			os.write(b);
			os.flush();
			os.close();
		}
		catch (Exception e) {
		}
		urlc = null; // section 3.2.5 of RFC1738


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1