Home > Web Front-end > JS Tutorial > jQuery file upload plug-in Uploadify usage guide_jquery

jQuery file upload plug-in Uploadify usage guide_jquery

WBOY
Release: 2016-05-16 16:46:00
Original
1375 people have browsed it

The HTML5 version will better support mobile browsers to avoid the Safari browser on Apple phones not supporting
Flash. Main features: support for multiple file uploads, drag-and-drop upload for the HTML5 version, real-time upload progress bar display, powerful Parameters
customization functions, such as file size, file type, button image definition, upload file script, etc.

How to use Flash version:
1. Load JS and CSS

Copy code The code is as follows:




4. More detailed explanation of parameter configuration

uploader: The relative path of the uploadify.swf file. The swf file is a button with the text BROWSE. When clicked, the
open file dialog box fades out. Default value: uploadify.swf.
script: Relative path to the background handler. Default value: uploadify.php
checkScript: The relative path of the background processing program used to determine whether the uploaded selected file exists on the server
fileDataName: Set a name, and the uploaded file is retrieved based on this name in the server processing program data. Default is Filedata
method: Submission method Post or Get Default is Post
scriptAccess: Access mode of flash script file, if set to always for local testing, default value: sameDomain
folder: Directory where uploaded files are stored .
queueID: The ID of the file queue, which is consistent with the ID of the div that stores the file queue.
queueSizeLimit: When allowing multiple files to be generated, set the number of selected files, default value: 999.
multi: Multiple files can be uploaded when set to true.
auto: Set to true and the file will be uploaded directly after selecting it. If set to false, you need to click the upload button to upload.
fileDesc: This attribute value must be set to the fileExt attribute before it is valid. It is used to set the prompt text in the file selection dialog box. For example, set
fileDesc to "Please select rar doc pdf file"
fileExt: Setting The file types that can be selected, the format is: '*.doc;*.pdf;*.rar'.
sizeLimit: The size limit of uploaded files.
simUploadLimit: The number of simultaneous uploads allowed. Default value: 1.
buttonText: Text of the browse button, default value: BROWSE.
buttonImg: Path to browse the image of the button.
hideButton: Set to true to hide the image of the browse button.
rollover: The values ​​are true and false. When set to true, there will be a reversal effect when the mouse moves over the browse button.
width: Set the width of the browse button, default value: 110.
height: Set the height of the browse button, default value: 30.
wmode: Set this item to transparent to make the flash background file of the browse button transparent, and the flash file will be set to the top layer of the page
. Default value: opaque.
cancelImg: The close button icon on each file after selecting the file into the file queue

The values ​​of the key values ​​​​introduced above are all strings or Boolean types, which are relatively simple, and will be introduced next. The value of the key value is a function that can return some information to the user when selecting a file, making an error, or other operations.

onInit: Do some initialization work
onSelect: Triggered when a file is selected. This function has three parameters
event: event object.
queueID: The unique identifier of the file, consisting of 6 random characters.
fileObj: The selected file object has 5 attributes: name, size, creationDate, modificationDate, and type.
The code is as follows:

Copy code The code is as follows:

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template