CodeIgniter Forums
How to implement a pic server? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to implement a pic server? (/showthread.php?tid=1784)



How to implement a pic server? - El Forum - 06-26-2007

[eluser]batteries[/eluser]
What is the correct way of implementing this type of setup? My best guess is that i should POST to a upload specific ci installation on the pic server that would deal with all file uploads. But then i would have to make a connection to my db.. hmmm, things will get a little more complicated.

..discuss Smile


How to implement a pic server? - El Forum - 06-27-2007

[eluser]rogierb[/eluser]
Why that complicated? Why not just one CI setup with DB in which you store the image data en FTP the image to the pic server? This way your pic server will be dedicated and your application server aswell

I don't see the need to mix seperate functionality.

so:
1: upload
2: store image data in DB (including image location)
3: store image in tmp dir
4: ftp image to pic server ( in specific location? )

Above odering might not be the best.


How to implement a pic server? - El Forum - 06-27-2007

[eluser]batteries[/eluser]
i do not want to use double the bandwidth on a single image. the point is for my application server bandwidth to be solely dedicated to generated html. Also, the pictures i'm referring to are user uploaded.


How to implement a pic server? - El Forum - 06-27-2007

[eluser]rogierb[/eluser]
So is it safe to say the servers are on different locations or at least not connected to each other? That would have made things a lot simpler.

As for user upload, that shouldn't make a difference. It al depends on how you process the upload.

Back to your question:

I would create an upload form with the action pointing towards the picserver and an ajaxcall from the picserver to the applicationserver with details of the uploaded image.

you would still need 2 CI installations but the picserver only needs a simple upload routine and an ajax call.