0

I'm working with the plugin Bootstrap File Input

I have this input file code:

inputfile: function(id_usu,rut){

    var self = this;
    $("#input_file_"+id_usu+"_id").fileinput({
        'language': "es",
        'showCancel': false,
        'showUpload':true, 
        'previewFileType':'any',
        'uploadLabel': "<strong style='color:rgb(65, 86, 62); font-weight: normal;'>Subir archivo</Strong>",
        'uploadAsync': false,
        'allowedFileExtensions': ["xls"],
        'uploadIcon': '<i class="glyphicon glyphicon-upload" style="color:rgb(65, 86, 62);"></i>',
        'uploadUrl' :"../../sistema/api/sistemaTareas/v1/subirarchivo",
        'showPreview': false,
        'elErrorContainer': '#kv_error_'+id_usu+'_2'
        }).on('filebatchpreupload', function(event, data, id, index) {
            $('#kv_success_'+id_usu+'_2').html('<h4>Estado:</h4><ul></ul>').hide();
        }).on('filebatchuploadsuccess', function(event, data , previewId, index) {
            var out = '';
            $.each(data.files, function(key, file) {
                console.info(data.response);
                if(data.response == 1){ 
                    $('#alert_'+id_usu+'_id').hide();
                    $('#success_'+id_usu+'_id').fadeIn(1000);
                    //$('#success_'+id_usu+'_id').fadeOut(3000);
                    $("#success_mensaje_"+id_usu+"_input_id").html('<li>Se guardaron los datos con éxito.</li>');
                }
                if(data.response == 2){
                    $('#success_'+id_usu+'_id').hide();
                    $('#alert_'+id_usu+'_id').fadeIn(1000);
                    //$('#alert_'+id_usu+'_id').fadeOut(3000);
                    $("#error_mensaje_"+id_usu+"_input_id").html('<li>Uno o más de los encabezados no concuerdan con la plantilla base.</li>');
                }
                if(data.response == 3){
                    $('#success_'+id_usu+'_id').hide();
                    $('#alert_'+id_usu+'_id').fadeIn(1000);
                    //$('#alert_'+id_usu+'_id').fadeOut(3000);
                    $("#error_mensaje_"+id_usu+"_input_id").html('<li>El archivo debe ser editable.</li>');
                }
                if(data.response == 4){
                    $('#success_'+id_usu+'_id').hide();
                    $('#alert_'+id_usu+'_id').fadeIn(1000);
                    //$('#alert_'+id_usu+'_id').fadeOut(3000);
                    $("#error_mensaje_"+id_usu+"_input_id").html('<li>El archivo no contiene datos.</li>');
                }
                if(data.response != 1 && data.response != 2 && data.response != 3 && data.response != 4){
                    $('#success_'+id_usu+'_id').hide();
                    $('#alert_'+id_usu+'_id').fadeIn(1000);
                    $("#error_mensaje_"+id_usu+"_input_id").html("Algunos días contienen inconsistencias <button type='button' class='btn btn-info' id='btn_"+id_usu+"_verincon_id' style='padding:0; color:blue; border: none; background: none;'><strong> ver </strong></button>");
                    self.setDatosModalIncon(id_usu,data.response,rut);
                }
            });

        });

},

I can send my xls file, but I need send a extra parameter, in this case the 'rut' parameter.

How can I do this?

Sorry by my english.

Jeanbf
  • 317
  • 1
  • 5
  • 15
  • What are you needing to do with the `rut` parameter? – R.A. Lucas Nov 27 '15 at 23:21
  • @R.A.Lucas I'm sending a xls file with bootstrap input file , but I need send the 'rut' parameter too, because I need use the data of rut in php with the data of the xls file. – Jeanbf Nov 28 '15 at 15:11

0 Answers0