Hey I'm looking for a new implementation to help with the image upload side of ImageBrowser. I want be able to have a quick upload form where people select an image on their computer. It processes the upload via AJAX and sends back a javascript message along with a fresh form for another image upload if required.

I want to move away from the Image module way of doing things by associating images with nodes, so just needs the images to be uploaded into the drupal files db. I can get ImageCache and Views to handle the rest.

I don't know if this is something upload_element supports already or if it might be a quick 'mod' I need to do myself. Any assistance would be hugely appreciated and credit would be given of course.

Comments

Alan D.’s picture

Sounds a bit different to how the upload element works, it is just a form widget. However, there is no reason why you can not simply create an AJAX form with an "upload element" field.

PS: If the form only has to deal with the file field, there is no real benefits to using the widget. Saving the element during validation / submission would do.

jdelaune’s picture

Ok thanks, are there any documentation on how to write a good AJAX form? I've written one but I'm not sure if it's the best way of doing it. Especially as some uploads just seem to stay processing forever and you need to reload the page.

Alan D.’s picture

I'm not really sure on the best approach. Every time I do it, I end up doing something slightly different. The base Drupal AHAH framework is very primitive, and is not the best example. Stella's site has a nice example for the node forms:

http://www.stellapower.net/content/ajax-ifying-drupal-node-forms

I'm sure you will be able to get some nice hints from it.

jdelaune’s picture

Status: Active » Closed (fixed)

Thanks