Welcome Guest, Not a member yet? Register   Sign In
How To Best Handle Image Uploads In A CMS

Standard file/image uploading isn't a problem, what IS a problem (that I've spent 2 days on, so far) is how to handle uploading an image on a form (like a posting screen in a CMS) without submitting the whole form. I don't want to use some pre-made complicated script, I need to do it in a way I can understand and build upon.

My preferred setup/logic is like so:

1. Form has a posting box, with a WYSIWYG editor. The image uploading will not be integrated.
2. I need to upload the image and display info about it on the page, but not submit the form because I don't want to do validation yet.

Essentially, this is the same way GMAIL handles uploads in emails. I believe they use an iframe to do this. Thoughts?

PS - I'm currently trying to get uploadify working (not sure why it doesn't work, as it works fine outside of CI). I'd really rather be able to do this with simple php/html/javascript in a controller/view though.

If you dont want to submit on image upload - this will work only with JS. Best to do make it work with no JS fallback.
Focusing only on JS solution (im gonna use jQuery here):
You can use http://valums.com/ajax-upload/ and as a response from server send html
<input type="hidden" name="images[]" value="uploadedimagefilename.jpg" />
<img src="uploadedimagefilename.jpg" />
and then just do jQuery JS
this way you will have your form updated with hidden fields having info on uploaded images and when submitting it POST will have all info to save them.

This is very simplified but should give you a hint.


I think this will ( http://www.viewsboard.com/index.php/dboa...ead/28/182 ) give u some help.

Theme © iAndrew 2016 - Forum software by © MyBB