0

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!

Community
  • 1
  • 1
Neeryck
  • 79
  • 1
  • 10

2 Answers2

0

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" />
bukk530
  • 1,858
  • 2
  • 20
  • 30
  • Perfect! That's exactly what I intend to do! But how can I pass (at the time of upload) the byte image server x.com to save on y.com/images/? – Neeryck May 10 '13 at 21:17
  • you have 2 ways: you can upload directly to X.com, record upload, and then pass the image to Y.com. otherwise you can upload to Y.com, which for every upload send a request to X.com letting him know he received an image (you can use a simple Json, and ssl for better security). the first method is simpler to implement, the second drains less bandwidth – bukk530 May 10 '13 at 23:10
0

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

Max
  • 842
  • 5
  • 16