Forums Register Login

Create file in java and write it to a different server on a different network

+Pie Number of slices to send: Send
I have a java application where I need to create a file, without an extension, in code and write it to a different server on another network. Our company currently is on 2 networks. Both servers are Windows. The server I need to write to will need a user name and password. What is the best way to do this? Examples would be helpful.
+Pie Number of slices to send: Send
How do you get to that other server?

Socket connection?

Protocol?

Or do you have to implement the receiving end as well?
+Pie Number of slices to send: Send
Protocol
+Pie Number of slices to send: Send
What protocol?
+Pie Number of slices to send: Send
I was thinking I would just be able to use the file protocol. I'm not sure. We haven't done anything like this before. From what I've seen, I think I should be able to use a URL object with the file protocol and set my username and password as an authorization on the RequestProperty.
+Pie Number of slices to send: Send
You say that a user name and password are going to be required, so I take that to mean that you won't have a drive mapped to that server on the machine where you're going to be creating this file.

So in that case a file:// URL isn't going to work because there isn't any way to find the target file on that source machine.

I have been using jCIFS for zapping files around Windows networks and it works just fine, even on computers which aren't running Windows.
+Pie Number of slices to send: Send
 

Paul Clapham wrote:
I have been using jCIFS for zapping files around Windows networks and it works just fine, even on computers which aren't running Windows.



In that case the protocol would be SMB.
+Pie Number of slices to send: Send
Thanks for the point in the right direction. That worked great.
+Pie Number of slices to send: Send
 

Matt Cartwright wrote:

Paul Clapham wrote:
I have been using jCIFS for zapping files around Windows networks and it works just fine, even on computers which aren't running Windows.



In that case the protocol would be SMB.



Correct. But in this case you don't have to go around begging for somebody to set up an "SMB server", as you might have to if you chose the FTP protocol. SMB is always-on in a Windows network.
Can you smell this for me? I think this tiny ad smells like blueberry pie!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2354 times.
Similar Threads
Writing a file across a network
Uploadin file in remote system
NX: Question about database location.
Applet security - is signing all you need?
creating and writing a new file on server
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:52:42.