This article mainly introduces the jQuery asynchronous file Upload plug-in ajaxFileUpload in detail. This article first describes the ajaxFileUpload parameters, error prompts, and other knowledge, and then provides simple examples and ASP. use instances in NETMVC mode. For more information, see
1. ajaxFileUpload is a jQuery plug-in for asynchronous file upload.
Upload a version that you don't know, so you don't need to find it in the future.
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.
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.
Error message:
1. SyntaxError: missing; before statement error
If this error occurs, check whether the url path can be accessed.
2. SyntaxError: syntax error
If this error occurs, check whether the server background processing program that handles the submitted operation has a syntax error.
3, SyntaxError: invalid property id error
If this error occurs, check whether the text domain property ID exists.
4, SyntaxError: missing} in XML expression error
If this error occurs, check whether the file name is consistent or does not exist.
5. other custom errors
You can directly print the variable $ error to check whether the parameters are correct, which is much more convenient than the above error prompts.
Usage:
Step 1: introduce jQuery and ajaxFileUpload plug-ins first. Pay attention to the order. Needless to say, this applies to all plug-ins.
The code is as follows: