Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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 :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).]
 
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 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
 
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic