Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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.
 
Sheriff
Posts: 24369
55
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.
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!