Reputation: 52523
I've just been tasked with abstracting the admin section of a website to its own separate domain on a separate (shared) hosting plan. Part of what the admin section does is upload pictures for products. Now that this admin section is no longer a part of the main domain, how can I upload products onto the main domain from the admin domain?
I'm using ASP.NET/VB.NET.
Thanks
EDIT Let me add that both systems are on shared hosting plans, so I don't really have any sort of ability to map drives or anything. I was looking for a programmatic way. Is there a way to have one site "call" the other and tell it which files to save onto the server?
Upvotes: 0
Views: 2642
Reputation: 2329
You can setup a webservice on the non-admin domain that will be called by the admin domain. So when you upload a new image in admin you:
It is far from being as easy as sharing a folder, but it would work.
Is the money saved on a shared server worth the time of implementing this? Who knows...
Upvotes: 2
Reputation: 73554
I have not yet found a more elegant solution, so I'm hoping you'll get a better answer than mine. I'm also not sure if this is even possible based on your setup.
What I normally do in this case is to do one of two options. Both involve mapping a network drive from the server where the images are uploaded to and then copying the files from the admin site to the main site.
Either I copy the files as soon as they are uploaded, or I write a separate script to copy the files. Possibly, on the Admin site, I would list the files that need to be copied and do the copy on a button click.
EDIT - added after the fact
This is one of those challenges that comes up regularly for me. Due to the extra overhead involved, I almost never put my admin site on a different server than the main site. The above methods are used only where I absolutely need to do this.
Upvotes: 0
Reputation: 7834
If they're on the same box, you can have one site write to the other site's file system (given the right permissions). But this sounds like it won't work in your shared hosting environment, though.
Otherwise, you could provide a URL for the main app to load images from the admin app, just make sure the images are saved to a place where they're accessible to the public.
Upvotes: 2