“file unggahan posting jQuery” Kode Jawaban

file unggahan posting jQuery


 $(document).ready(function() {
     $('#ProblemUpload').submit(function(e){
         e.preventDefault();
          $('#ProblemUpload').find('button').prop('disabled',true);
            var file_data = $('#fileData').prop('files')[0];   
            var form_data = new FormData();                  
            form_data.append('file', file_data);
            form_data.append('action', 'upload_sheet');
            $('#loaderWapper').slideDown();                         
            $.ajax({
                url: baseUrl+'apis/auth.php', // <-- point to server-side PHP script 
                dataType: 'text',  // <-- what to expect back from the PHP script, if anything
                cache: false,
                contentType: false,
                processData: false,
                data: form_data,                         
                type: 'post',
                success: function(php_script_response){
                    let response = JSON.parse(php_script_response);
                    if(response.status == 'success'){
                        alertify.alert('Data inserted',response.msg );
                        $('#ProblemUpload').trigger('reset');
                    }else{
                        alertify.error(response.msg)
                    }
                    $('#loaderWapper').slideUp();    
                    $('#ProblemUpload').find('button').prop('disabled',false);
                }
            });
     })
 })
Singh99

unggahan file di jQuery

$(function(){
    $('#uploadBTN').on('click', function(){ 
        var fd = new FormData($("#fileinfo"));
        //fd.append("CustomField", "This is some extra data");
        $.ajax({
            url: 'upload.php',  
            type: 'POST',
            data: fd,
            success:function(data){
                $('#output').html(data);
            },
            cache: false,
            contentType: false,
            processData: false
        });
    });
});
Careful Cobra

Jawaban yang mirip dengan “file unggahan posting jQuery”

Pertanyaan yang mirip dengan “file unggahan posting jQuery”

Lebih banyak jawaban terkait untuk “file unggahan posting jQuery” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya