I need to upload a single image to server. The project is using .NET MVC, jQuery and jQueryUi. I’m looking for a mechanism that works given the following restrictions:
- I can’t modify the view files (.ascx), since almost all the GUI is constructed dinamically from JS. So I can’t do things like define a div with some id in the ascx page and then find that id from javascript using a jQuery selector to do other things with it.
- If there’s some html involved it would have to be generated from JavaScript code, but not injected to any existing html elements. As I’ve already said, my ascx pages are pretty much empty.
- I’d like to filter extensions, so that only image files are uploaded.
- The button triggering the upload is in a dialog, not in a permanent html element.
- Not using flash.
The images are uploaded to a folder in the web server, not to DB. Extra features (such as progress bar) are not really needed.
I want to know if that is possible using jQuery (or some jQuery plugin).
Well, I’m now using Valums Ajax Uploader. It complies with my requirements, but it is hardly customizable to my needs, and it is not well documented.