问题描述:

I have two machines that will be an application server in each.

The machine X is dynamic sources. The machine Y is static sources.

Thus, the user is always connected to "x.com".

When he does one upload an image, I need to send this information to "y.com".

How can I pass (at the time of upload) the byte image server x.com to save on y.com ?

See here what I started doing:

http://forum.primefaces.org/viewtopic.php?f=3&t=30239&p=96776#p96776

Balusc answered very well here:

Simplest way to serve static data from outside the application server in a Java web application

But my case is slightly diferent.

I appreciate any help!

Thank you!

网友答案:

Use share network disk like: samba or NFS. Ootionaly you can consider to setup rsyncs if you have Linux/U*x hosts

网友答案:

I think the simplest way is to create a database table on X.com to track all images your user store on Y.com, for example:

+----------+-------------------------+
| user_id  |       image_path        |
+----------+-------------------------+
|       0  | /images/image_xxxxx.jpg |
|       0  | /images/image_xxxxx.jpg |
|       2  | /images/image_xxxxx.jpg |
|       2  | /images/image_xxxxx.jpg |
|       3  | /images/image_xxxxx.jpg |
+----------+-------------------------+

and then serve on X.com all your images redirecting the browser to Y.com

X.com:

<img src="Y.com/images/image.xxxxx.jpg" />
相关阅读:
Top