CodeIgniter Forums

Full Version: How to implement a pic server?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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

El Forum

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.

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.

El Forum

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.

El Forum

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.