Jquery plupload multipart_params

I am using the plupload plugin.

I have this input form:

<div id="flash_uploader" style="width: 610px; height: 330px;">You browser doesn't have Flash installed.</div><input type="text" name="categorie" id ="categorie" value="" /><input type="submit" value="send" />

I am trying to get the value of "categorization" using "multipart_params", but this will not work!

$("#flash_uploader").pluploadQueue({
    // General settings
    runtimes : 'flash',
    url : '../scripts/plupload/examples/upload.php',
    max_file_size : '700kb',
    chunk_size : '1mb',
    unique_names : false,
    multi_selection : true,
    multipart : true,
    multipart_params : {categorie : $('#categorie').val()},
    filters : [
        {title : "Image files", extensions : "jpg,png"}
    ],
    // Resize images on clientside if we can
    resize : {width : 550, height : 550, quality : 94},
    // Flash settings
    flash_swf_url : '../scripts/plupload/js/plupload.flash.swf'
});

How can I send the "categorization" value of input in pluploadQueue to .. /scripts/plupload/examples/upload.php?

Thank you for your help...

+3
source share
2 answers

After block

$("#flash_uploader").pluploadQueue({...})

Bind BeforeUpload Event

var uploader = $('#flash_uploader').pluploadQueue();
uploader.bind('BeforeUpload', function(up) {
  up.settings.multipart_params.tags = $('#categorie').val();
});

It works for me, hope it can solve your problem.

+8
source

javascript ( ), : ( , id = "nuova_categoria" / id = "categoria_esistente" )

init: {
    PostInit: function() {
        document.getElementById('filelist').innerHTML = '';

        document.getElementById('uploadfiles').onclick = function() {
            uploader.settings.multipart_params.new_cat = $('#nuova_categoria').val();
            uploader.settings.multipart_params.existing_cat = $('#categoria_esistente').val();
            uploader.start();
            return false;
        };
    }, 

"onclick" . , . - www.infoarredo.it

0

Source: https://habr.com/ru/post/1754377/


All Articles