This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code to Download a file from Server

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Could someone please assist me with a java code not servlet or jsp. To download a file (any type) from client to server
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of server - FTP, HTTP, something else?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I say Server that is a UNIX BOX in that my application is running on OC4J.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server needs to be set up to serve files somehow. The approach you'd take to download files depends on the ways in which the server is prepared to serve them. Or are you saying that you can configure and/or code the server in whichever way is most convenient for the client?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes exactly !!!

Need code for most convenient to the client..
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I'd go with FTP (assuming that a shared directory is not an option). The Apache Commons Net library contains everything you need to write an FTP client.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I need to print some datas from server in client printer. Can I print it directly from the server or download it to client machine then send it to printer. which is a better option
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the client printer is a network printer, then the server should be able to access it. if the printer is connected directly to the client computer, then it won't work.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf. But my question is regarding performance, Printer from the server is better or downloading the content to client and sending it to printer is good
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions are welcome
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Performance as defined how - the time it takes to print something? I hope you're not basing any architectural decisions on something like that. Furthermore, the performance is irrelevant if it isn't possible at all (like if a desktop printer isn't reachable by the server).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic