Hi
I am developing an image hosting website.I want images uploaded to go to another server , not the one where the script is hosted.For e.g i want images to be uploaded to http://i1.mysite.com instead of http://mysite.com/uploads
Suppose i have this code to upload file to server
<form action="http://mysite.com/upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input type="file" name="image" id="file_upload" />
<input type="submit" value="Upload" id="upload_submit" />
</form>
Ofc i could always change the form action to<form action="http://i1.mysite.com/upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
But I'd be redirected to http:/i1.mysite.com/upload
after upload
I am thinking that i could create a php that do ftp connection to the storage server(aka where the images will be stored).However how will i make the storage server be recognise as .i1 (sorry if noob question but more a learning project for me that i intend to use later)
Also i want the site to redirect to this after uploadhttp://mysite.com/upload
then on the upload page i will show link to image.For e.ghttp://i1.mysite.com/upload/i3fRT.png
I am doing this because of the following reason:
1)Need to have the ability to add new servers as site grows(aka adding new server i2 , i3 etc)
2)Want optimum for performance for user - can tweak the servers which will store images to server them best at most efficient way
Do you think it is logical to use a dedicated server to store both the site script and images , then when space becomes low on dedicated server to add some vps e.g i2, i3?
Need your views , suggestion and help
Much appreciated:)