Use Case:Working on a project where user can create his own site and publish it to internet.(Something similar to this or this). The user can create and later edit his website.When the user wants to publish we create a domain of his choice(a subdomain at first.Can be a different domain later).
Issue:What we want to do is,have the images stored directly on the domain created for the user(The domain initially would be created as a subdomain).For example,our site is at www.xyz.com,then the subdomain can be ABC.xyz.com.This will help to maintain a single copy of images for both the publish and the edit domain.We don't want to store the same image at two different locations.
Research:
Two possibilities that I found could be used:
1) Have a php upload script(upload.php
) on each domain created that would be called when user uploads any image.-->Not sure how efficient it would be
2) Use FTP to transfer images from a domain to another.(Some cross domain mechanism)-->Not sure about the security issues here
Do I need to have any kind of cross domain script to be written?Please,help me with how to go about the issue.I don't want the entire code but the logic that would take me in the right direction.Suggestions,if my approach is wrong are welcome.Thank you for your time.
Note: I am still figuring out other alternatives.If I get my code in some shape,will update it.