views:

23

answers:

2

Hello fellow programmers,

I have a page that allows users to submit photos to the server. On another server I need to have a page that will have access to those photos on the first server and give possibility to upload/delete photos. What choices do I have considering that I have full access to both servers and I don't want to use php ftp.

Thanks

+1  A: 

I need to have a page that will have access to those photos on the first server and give possibility to upload/delete photos.

You need to have a look at Same Origin Policy:

In computing, the same origin policy is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site to access each other's methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites.

For you to be able to get data, it has to be:

Same protocol and host

You need to implement JSONP to workaround it.

Sarfraz
A: 

One thing you can do is to setup a a shared drive (NAS - Network attached storage) between these boxes that the files will be stored on, then you will have access to the files from both servers.

The NAS shares can be mounted via NFS (assuming you using Linux)

HTH

NiGhTHawK