First, unzip the downloaded Uploadify compressed package and put it in the public folder. The implementation code is as follows:
1. Frontend html part:
var img_id_upload=new Array();//Initialize the array to store the uploaded picture name
var i=0;//Initialize the array subscript
$(function() {
$('#file_upload'). uploadify({
'auto' : false,//Turn off automatic upload
'removeTimeout' : 600,//Delete the file queue 1 second after the upload is completed
'swf' : '/Public/uploadify/uploadify.swf',
' uploader' : '/_URL_/Article/uploadify',
'method' : 'post', //Method, the server can use the $_POST array to obtain data
'buttonText' : 'Select image', //Set button text
'multi' : true, //Allow multiple images to be uploaded at the same time
'uploadLimit' : 8, //Only a maximum of 10 images are allowed to be uploaded at a time
'fileTypeDesc' : 'Image Files', //Only images are allowed to be uploaded
'fileTypeExts ' : '*.gif; *.jpg; *.png',//Limit the suffix of pictures that are allowed to be uploaded
'fileSizeLimit' : '2000KB',//Limit the size of uploaded pictures
'onUploadSuccess' : function(file, data , response) { //The callback function executed after each successful upload, returns data from the server to the front end
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn