File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes FTP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "FTP" Watch "FTP" New topic
Author

FTP

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Is it possible to write a program in java that can do a FTP file transfer
Todd M Bush
Greenhorn

Joined: Apr 26, 2000
Posts: 22
Sure is. I'm working on one right now. There are a few examples out there as well.
Pawel Veselov
Ranch Hand

Joined: Jan 14, 1999
Posts: 165
And you can check out this page:
http://www.alphaworks.ibm.com/ab.nsf/bean/FTP+with+Source

------------------
With best of best regards, Pawel S. Veselov ( aka Black Angel )

With best of best regards, Pawel S. Veselov ( aka Black Angel )
Savithri Devaraj
Ranch Hand

Joined: Jun 26, 2000
Posts: 103
Could some post some examples for ftping files over to an IP address?
Iam thinking of using the URL class with protocol=ftp. Is this the way to do it?
Thanks,
Savithri
teiag
Greenhorn

Joined: Jun 21, 2001
Posts: 2
Is there a way to run unix shell script through Java?
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Yes there is. You have to understand a little about the URL it is expecting.
ftp://username :password@ftp.server.com/full/path/to/file/filename;type=x
type for getInputStream can be 'd' for directory listing, 'a' for Ascii down load and 'i' for Binary download.
type for getOuputStream can be 'a' for ascii upload and 'i' for binary upload.
So, to put a text file you can use code similar to the following


------------------
Hope This Helps
Carl Trusiak, SCJP2
[This message has been edited by Carl Trusiak (edited June 23, 2001).]
[This message has been edited by Carl Trusiak (edited June 23, 2001).]


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Savithri Devaraj
Ranch Hand

Joined: Jun 26, 2000
Posts: 103

[/b]
</BLOCKQUOTE>
Carl,
I appreciate your help here, but what is "/full/path/to/file/filename"?? Did you mean "filedirectory/filename" ??
I am pretty much doing the same thing, but I get an exception on the getOutputStream() statement. UnknownServiceException" - This service is not supported by the protocol.
Only difference is - I am not setting type='a'. I am going to try that next.
Any ideas??
Savithri

[This message has been edited by Savithri Devaraj (edited June 26, 2001).]
Savithri Devaraj
Ranch Hand

Joined: Jun 26, 2000
Posts: 103
Originally posted by Carl Trusiak:
[B]Yes there is. You have to understand a little about the URL it is expecting.
ftp://username assword@ftp.server.com/full/path/to/file/filename;type=x
type for getInputStream can be 'd' for directory listing, 'a' for Ascii down load and 'i' for Binary download.
type for getOuputStream can be 'a' for ascii upload and 'i' for binary upload.
So, to put a text file you can use code similar to the following

[/B]

Carl,
Where can I find more information to read up on this?
Savithri
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Your name 'teiag' does not comply with the JavaRanch naming policy. Please spare a moment and re-register with a name that meets the requirements.
Thanks!

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Pratik Khetia
Ranch Hand

Joined: Jun 29, 2001
Posts: 50
Originally posted by Pawel Veselov:
And you can check out this page:
http://www.alphaworks.ibm.com/ab.nsf/bean/FTP+with+Source


peter rapier
Greenhorn

Joined: Jul 24, 2001
Posts: 4
The ibm alphaworks ftp beans moved here:
http://oss.software.ibm.com/developerworks/opensource/ftp/index.html
peter rapier
Greenhorn

Joined: Jul 24, 2001
Posts: 4
The ibm alphaworks ftp beans moved here:
http://oss.software.ibm.com/developerworks/opensource/ftp/index.html
khurram mirza
Greenhorn

Joined: Jun 10, 2001
Posts: 25
i've to upload some file form client side to server side.besides writing the java code for file transfer as suggested by some of you,Whether i've to run ftp service at server side where web server is already running or not.
khurram mirza
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FTP