user319854
user319854

Reputation: 4106

use two jquery uploadify scripts

Is it possible to use two uploadify scripts in one page?

When first script finishes uploading data, then second one should start.

Is this possible?

...................

sorry that is not explained clearly.

I wish have two uploadify script in one page. One uploadify script upload only images, second only pdf files.

Upvotes: 0

Views: 749

Answers (2)

JellyBelly
JellyBelly

Reputation: 2431

Yes!

HTML

<input type="file" id="file_kpi_36" name="file_kpi_36" class="inputFileUploadify"/>

when the number 36 is dinamical!

JS

$(document).ready(function() {
    $(".inputFileUploadify").each(function() {
        var myID = $(this).attr('id');
        $('#' + myID).uploadify({
            'uploader'      : '/uploadify/uploadify.swf',
            'script'        : '/uploadify/uploadify.php',
            'cancelImg'     : '/uploadify/cancel.png',
            'expressInstall': '/uploadify/expressInstall.swf',
            'folder'        : '/uploads',
            'displayData'   : 'percentage',
            'method'        : 'post',
            'simUploadLimit': 1,
            'queueSizeLimit': 1,
            'sizeLimit' :    10485760,
            'auto'          : true
        });
    });
});

try and you see! ;)

Upvotes: 0

daGrevis
daGrevis

Reputation: 21333

To use two or more Upladify instances, each of them must have an unique ID (not class!).

$('#upload_1').uploadify({ ... });
$('#upload_2').uploadify({ ... });

Upvotes: 1

Related Questions