• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

FTP

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to write a program in java that can do a FTP file transfer
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure is. I'm working on one right now. There are a few examples out there as well.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 )
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way to run unix shell script through Java?
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes there is. You have to understand a little about the URL it is expecting.
ftp://username :[email protected]/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).]
 
Savithri Devaraj
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[/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
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Carl Trusiak:
[B]Yes there is. You have to understand a little about the URL it is expecting.
ftp://username [email protected]/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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pawel Veselov:
And you can check out this page:
http://www.alphaworks.ibm.com/ab.nsf/bean/FTP+with+Source


 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ibm alphaworks ftp beans moved here:
http://oss.software.ibm.com/developerworks/opensource/ftp/index.html
 
peter rapier
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ibm alphaworks ftp beans moved here:
http://oss.software.ibm.com/developerworks/opensource/ftp/index.html
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic