Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Save files to Server

 
mandahr James
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a simple java program which use FileOutputStream to save a file. I need to save files on server machine. Currently when I access it from client file saved on client machine. Application is running from server and i am accessing it from client machine.

192.168.1.12/client/application

192.168.1.1 is the server



here is the code



Please help me

 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the code is running on the client then what are you using to talk to the server?
 
mandahr James
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what I need to talk to server? How I can achieve this?
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, is there a webapp running on the server?
Can you FTP to it?
Maybe samba?

Essentially you need some way to talk to the server and then access wherever you want to write the file to.
And that will quite likely not involve a FileOutputStream.
 
mandahr James
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah this is logical. Can you show me some example? Can we use HTTP POST for accessing server location?
 
Paul Clapham
Sheriff
Posts: 21581
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you want to upload a file to a server machine then a multipart HTTP POST request is a common way to do that. Of course you would have to have an HTTP server running on that server machine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic