Start upload after choosing a file, using jQuery.

后端 未结 3 1477
醉酒成梦
醉酒成梦 2021-01-31 17:29

After having chosen a file for upload, I want the file to be uploaded to database without the click of a button. How is this done using jQuery?

I would like to choos

3条回答
  •  情歌与酒
    2021-01-31 18:28

    Use jQuery's plugin uploadify

    It's great plugin which has many options, and auto-upload, too

    $(document).ready(function() {
      $('#file_upload').uploadify({
        'uploader'  : '/uploadify/uploadify.swf',
        'script'    : '/uploadify/uploadify.php',
        'cancelImg' : '/uploadify/cancel.png',
        'folder'    : '/uploads',
        'auto'      : true
      });
    });
    

提交回复
热议问题