There is no such thing as "just a URL". An absolute URL always contains a scheme part that describes the protocol to use for accessing that URL (HTTP in this case). Most HTTP servers do no support content creation on URLs by default.
The most common way to put content on an HTTP server is to use FTP to put the content in a place on the server the HTTP server looks at.
However, if you control the HTTP server, you could set it up to respond to PUT or POST requests in the way you want, possibly by using WebDAV.
came across the same problem.
(just an aside on the last reply -- the originator is not talking about an HTTP server (port 80 for apache httpd but rather a servlet container -- from port 8080 for Tomcat in the first post).
from an inspection of the API, this is what strikes me:
could construct a URI and pass that to a File constructor and use that in turn to construct a FileOutputStream. Using the FOS, you could then write a file into a url (more precisely a URI location).
Haven't tried it myself, but this is what I suggested to a friend who was facing the same problem.
What you are trying to do is, in fact, uploading a file.
Now the last thing you want is for anyone to be able to write files onto your web server, so there's no built-in capacity to write to one. There is, in fact, a "PUT" transaction type defined in HTML but servers never implement it directly, in a way that allows you to write arbitary files to the server. It would be a security nightmare.
What you need to do is to have a Servlet which accepts uploaded data, using either a PUT or a POST transaction type and stores them sensibly. The servlet controlls how much data can be stored where.
Then it's easy enough to send data to that servlet.