I get a script that creates a form with an input file after clicking on a link, but when I load the function creating the form, the success callback is immediatly called. Did you get the same problem ?
Here's my function :
html = $('<div>');
form = $('<form method="post" action="">');
form.append('<input type="file" name="image" value=""> <input type="submit" value="OK">');
html.html('Ajouter une nouvelle image : <br>');
html.append(form);
$(options.area).prepend(html);
ajaxOptions = { iframe : 'true',success: function(res) { alert(res); } };
$(options.area).find('form').ajaxSubmit(ajaxOptions);
Thanks for your help !