Simple HTML

<input type="file" id="one-specific-file" name="one-specific-file">

Use as little as

$('#one-specific-file').ajaxfileupload({
  action: '/upload.php'
});

or as much as

$('input[type="file"]').ajaxfileupload({
  action: '/upload.php',
  valid_extensions : ['md','csv'],
  params: {
    extra: 'info'
  },
  onComplete: function(response) {
    console.log('custom handler for file:');
    alert(JSON.stringify(response));
  },
  onStart: function() {
    if(weWantedTo) return false; // cancels upload
  },
  onCancel: function() {
    console.log('no file selected');
  }

});

参考网址 https://github.com/jfeldstein/jQuery.AjaxFileUpload.js

jquery.ajaxfileupload.zip

附件下载:
jquery.ajaxfileupload.zip 18.12KB

et_highlighter