Welcome Guest, Not a member yet? Register   Sign In
Image Uploads In A CMS
#1

[eluser]mattcairns[/eluser]
Hi Everyone,
I am just trying to decide the best way to handle this, and thought I would reach out to the community for advice. I have written a number of CMS applications, first with just straight php and mysql and now with Codeigniter. One area that I really hope to improve is the file uploading process. In past applications, if I was creating an image gallery, for example, the form would have a an input field for photo credit, and a file field in which to upload an image. On submission, the file would be uploaded, cropped, scaled, etc, then the entry would be saved to the db. The entry would contain 3 items, an id, varchar field for the photo credit, and a varchar field with the file name. It works fine, the job gets done and I am able to use the photos in my gallery.

The downside, almost zero user display. If the form holds up on a larger file, or if for some reason the form crashes, I have no way to keep the user informed. So my solution is the AJAX style submit to iFrame trick. I love this, the user gets confirmation that the file is uploading, and with Codeigniter it is easier than ever to spit out error messages.

My issue with this is, it is difficult to create a new entry with an image upload. If the user uploads an image without first saving the form, the image does not have anywhere to save, and I don't want to create a 2 stage form, where the user uploads an image, then enters details.

I am thinking of using a separate table to hold all my uploaded media. So on an upload, the file is saved to its own table, with it's own unique id. I can then link this image to the entry using that id. Is this too sloppy and over complicated? I don't know if it is or not, or if I am just trying to improve something that doesn't need to be improved.

What ways do you have to handle image/file uploads that are related to posts in a CMS?

Thank you very much for any advice!

Matt




Theme © iAndrew 2016 - Forum software by © MyBB