This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Updating to Remote host  RSS feed

 
Ranch Hand
Posts: 62
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am not new to java but never done socket programming before. I was reading about reading a file from remote host is possible with URL but couldn't find if it is possible for client to update the file back to the server(Remote host not the local host)?
Can anyone please make me understand this. And if not possible then why?  

Thanks in advance.
JJ
 
Rancher
Posts: 3353
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What software is running on the remote host?  How is your PC connected to the remote host?
 
Jeena Jeen
Ranch Hand
Posts: 62
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its connected through http. Remote host is just a web server supporting java and can accept Binary content.
 
Marshal
Posts: 24198
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can certainly upload (not "update") a file to a web server, provided that the server provides a page which supports that. When you say it "can accept binary content" it sounds to me like there is a page which supports uploads.

You can write your own Java code for doing file uploads, but you have to learn a whole lot of boring details about the HTTP specifications. But it's really better to use Apache's HttpClient package -- you don't have to learn the boring specs and it works already.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!