jQuery auto upload file

I want the file input will automatic upload my image without enter any submit button.

<form action="/upload/" method="post" enctype="multipart/form-data">
  <input type="hidden" name="user_id" value="47" />
  <input type="file" name="upload" />

Let me know the trick with jQuery



You can submit the form on the file input's onchange event, like this:

$("input[name=upload]").change(function() {

With more recent versions you can also just set the autoUpload option to true:

$('#fileupload').fileupload({ autoUpload: true });


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.