In-depth analysis of the AjaxFileUpload implementation of a single file Ajax File Upload library, ajaxfileuploadajax

Source: Internet
Author: User

In-depth analysis of the AjaxFileUpload implementation of a single file Ajax File Upload library, ajaxfileuploadajax

JQuery. AjaxFileUpload. js is a jQuery plug-in used to upload files through ajax.

Syntax:

$.ajaxFileUpload([options])

Options parameter description:

1. url upload handler address.

2. the ID of the file field to be uploaded by fileElementId, that is, the ID of <input type = "file">.

3. Whether secureuri enables secure submission. The default value is false.

4. Data Type returned by the dataType server. It can be xml, script, json, or html. If this parameter is left blank, jQuery will automatically judge it.

5. The processing function automatically executed after successful submission of success. The parameter data is the data returned by the server.

6. The processing function automatically executed when the error is submitted.

7. Custom data parameters. This is useful when data is related to uploaded images.

8. If you want to submit a custom parameter, set this parameter to post.

Features:

It does not rely on specific HTML, as long as it is given a "<INPUTTYPE =" file ">

It does not need to specify any specific method when your server responds.

Allows you to operate on large volumes of files.

Sample Code:

-- Use as little as --$('#one-specific-file').ajaxfileupload({'action': '/upload.php'});-- or as much as --$('input[type="file"]').ajaxfileupload({'action': '/upload.php','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');}});

For more information about how to use AjaxFileUpload to upload an Ajax file to a single file, I hope it will help you!

Articles you may be interested in:
  • Jquery-ajaxfileupload asynchronous upload plug-in (with Engineering Code)
  • Use the ajaxfileupload plug-in to implement non-refreshing File Upload Methods
  • Example of asynchronous file upload using AjaxFileUpload. js
  • PHP + ajaxfileupload + jcrop plug-in perfectly achieves Avatar upload and tailoring
  • An example of a simple jQuery plug-in ajaxfileupload. js to implement ajax File Upload
  • Use ajaxfileupload. js to upload files to php through ajax
  • The ajaxFileUpload. js plug-in supports Multifile upload.
  • ThinkPHP combined with AjaxFileUploader to implement the method of uploading non-refreshing files
  • Asp.net + ajaxfileupload. js Implement Asynchronous file upload and code sharing
  • PHP uses the jQuery plug-in ajaxFileUpload to Implement Asynchronous file upload.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.