"Uploadify" uploadify upload number limit

Source: Internet
Author: User

function DeleteUrl () {     $ ("body"). On ("click", ". Img-wrap. Mask span", function (event) {        event.stoppropagation ( );                          var qs=$ (' #file_upload-queue>div ');//All Queue        var id=qs.eq (2). attr (' id ');//Get the third queue ID        $ (' # Uploadtowedaccredit '). Uploadify (' Cancel ', id);//This will be done, automatically resetting the number of queues and deleting DOM objects, not directly Qs.eq (2). Remove (), invalid/                  *        if ( !window.confirm ("Are you sure to delete the attachment?" ")) {            return;        }        var imgurl=$ (this). Parents (". Img-wrap"). FIND ("img"). attr ("src");        DeleteImage (Imgurl);        $ (this). Parents (". Img-wrap"). Remove ();        */    });};

<li class= "Blockli clearfix" style= "padding-bottom:5px;" >    <span class= "left-name" ><em class= "Red-star" >*</em> tractor power of Attorney:</span>    <div class= "Upload-wrap"  style= "width:100px;" >        <input  type= "file" Name= "Uploadtowedaccredit" id= "Uploadtowedaccredit" class= "Filetext"/>    </div>    <span id= "Uploadtowedaccreditlinktip" class= "warn-tips" ><em></em> please upload attachments, upload up to ${ Towedaccreditpicmax} Zhang </span>    <div id= "Towedaccreditdiv" class= "Up-img-list clearfix" ></div> </li>

  

Upload drag machine power of Attorney function Uploadtowedaccreditinit () {$ ("#uploadTowedAccredit"). Uploadify ({' Hidebutton ': ' true ', ' preventcaching ': ' true ', ' checkexisting ': ' true ', ' swf ': swf, ' uploader ': uploadimg, ' Deb         UG ': false, ' multi ': true, ' method ': ' Post ', ' preventcaching ': true, ' removecompleted ': true, ' Removetimeout ': Ten, ' requeueerrors ': true, ' successtimeout ': +, ' uploadlimit ': ${toweda Ccreditpicmax}, ' Fileobjname ': ' Filedata ',//single picture Max limit ' filesizelimit ': ' 1024KB ', ' F Iletypedesc ': ' Image Files ',//upload jpg image only ' filetypeexts ': ' *.jpg;*.png ', ' height ': ', ' wid Th ': ButtonText ': ' Upload attachments ', ' auto ': true, ' buttonclass ': ' Uploada btn-fff-24 ', ' Onswfre Ady ': function () {}, ' OnInit ': function () {//$ ("#file_upload-button"). CSS ("width", "10         0 ");         },                Select picture to complete ' onSelect ': function () {},//Cancel upload ' OnCancel ': function (f ile) {}, ' OnCheck ': function (Event,data,key) {},//Start uploading ' onuploadstart ': function (fi        Le) {$ ('. Uploadify-queue '). html ('); },//upload process ' onuploadprogress ': function (file, bytesuploaded, Bytestotal, totalbytesuploaded, total            Bytestotal) {$ ('. Uploadify-queue '). html (');        $ ("#uploadTowedAccreditLinkTip"). html (' <em></em> upload ... ');                },//upload complete ' onuploadcomplete ': function (file) {$ ('. Uploadify-queue '). html (');        $ ("#uploadTowedAccreditLinkTip"). html (' <em></em> upload successfully, pending submission ');  },//upload succeeded ' onuploadsuccess ': function (file, data, response) {var obj = eval (' + data               + ') ');               var Result=obj.result; if (result== "true") {VAR filename=obj.filename;                   $ ('. Uploadify-queue '). html ('); $ (' #towedAccreditDiv '). Append ("<div class= ' img-wrap ' ><div class= ' mask ' ><em></em><span></span></div></div> '); }},//upload failed//attachment format is incorrect, please upload jpg, BMP, PNG format file, size not more than 3MB ' Onuploaderror ': function (file, errorcod E, errormsg, errorstring) {switch (ErrorCode) {Case-100:alert ("the number of uploaded files has exceeded System-Restricted "+$ (' #uploadTowedAccredit '). Uploadify (' Settings ', ' queuesizelimit ') +" Files!                    ");                Break Case-110:alert ("File [" +file.name+ "] size exceeds the system limit of" +$ (' #uploadTowedAccredit '). Uploadify (' Settings ', ' Filesiz Elimit ') + "size!                    ");                Break Case-120:alert ("File [" +file.name+ "] size is abnormal!                    ");                Break           case-130:         Alert ("File [" +file.name+ "] type is incorrect!                    ");            Break }},//upload failed//attachment format is incorrect, please upload jpg, BMP, PNG format file, size not more than 3MB ' Onselecterror ': function (file, ErrorCode, Errorm              SG) {var msgtext = "Upload failed \ n"; Switch (errorCode) {case Swfupload.queue_error.                    Queue_limit_exceeded:var Towedaccreditdivlen = $ ("#towedAccreditDiv"). Children (). length;                      Msgtext + = "max uploads per upload" + $ (' #uploadTowedAccredit '). Uploadify (' Settings ', ' uploadlimit ') + "files";                  Break Case Swfupload.queue_error. File_exceeds_size_limit:msgtext + = "File size exceeds limit (" + $ (' #uploadTowedAccredit '). Uploadify (' Settings ', ' fi                      Lesizelimit ') + ");                  Break Case Swfupload.queue_error.                      Zero_byte_file:msgtext + = "File size is 0";                  Break Case Swfupload.queue_error.                Invalid_filetype:      Msgtext + = "file format is incorrect, limited to" + $ (' #uploadTowedAccredit '). Uploadify (' Settings ', ' filetypeexts ');                  Break              Default:msgtext + = "Error code:" + ErrorCode + "\ n" + errormsg;        } alert (Msgtext);         }   });  Determine if the user has flash var obj = $ ("#uploadTowedAccredit") installed. Children (). EQ (0);        if (obj.attr (' type ')! = "Application/x-shockwave-flash") {alert (' system detects that your browser does not have a flash plugin installed, in order for you to upload images normally, it is recommended that you install Flash ');   Return } $ ("#uploadTowedAccredit"). CSS ("float", "left");};

  

"Uploadify" uploadify upload number limit

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.