javascript - Start upload after choosing a file, using jQuery. -


after having chosen file upload, want file uploaded database without click of button. how done using jquery?

i choose file this: http://i.stack.imgur.com/0408t.gif

<input type="file" valign="baseline" /> 

assuming you're using form:

// select file input (using id faster) $('input[type=file]').change(function() {      // select form , submit     $('form').submit();  }); 

edit: to keep answer up-to-date:

there nice way upload files via ajax without hacks described here: http://net.tutsplus.com/tutorials/javascript-ajax/uploading-files-with-ajax/


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -