On Sat, 21 Feb 2009 16:39:47 -0800, Angel Lowelle wrote:
> I have problem to create a file in remote server, I got exception when I
> create a file in remote server. Maybe I couldn't do in the following
> way? When I tested this code to write the file in the same server, it is
> fine. I already give the write permission in the images folder. I don't
> know what went wrong, please advice. thanks
>
> File file = new File("http://another_server/images/file1"); output =
> new BufferedWriter(new FileWriter(file)); output.write(text);
The URI in this File constructor is supposed to be a file: URI. If you
have a share to this other location I expect that would work.
To do what it looks like you want to do, you really need the target
server to have a capability for file creation through some protocol.
Whether it's Apache with mod_dav (WebDAV) or some other content
management system with a Web API. Or FTP for that matter.
AHS
|