Search code examples
ajaxsymfonysymfony-sonata

Symfony Sonata AJAX image multi-upload


I am trying to create a portfolio site and am stuck finding a good approach to deal with images. I have integrated the SonataAdmin Bundle and have setup Admin classes for "Projects" and "Images". My goal is to go into a Project and add images to it and select one of these images as the Project thumbnail.

Ideally I would like to integrate an AJAX multi-uploader. I am not sure the best approach for this and am looking for any suggestions / thoughts.

I have looked at the Sonata Media Bundle, though it seems more robust than I actually need and the learning curve to customize it seems a bit steep. I have already setup an image entity (symfony2 cookbook for uploading documents) I imagine I can create a many-to-one on images and projects rather than using the MediaBundle, though I am still at a loss of how to integrate an AJAX script for this.

Thanks in advance for any advice! Shawn


Solution

  • So I endedup using Valumns Ajax multi uploader: http://valums.com/ajax-upload/

    I tried to customize the Sonata Admin Page but this proved a bit difficult, Instead I simply created a route / controller / view specifically for uploading batch images. It seems to be working great!