“Jenis Input Ukuran Batas File” Kode Jawaban

Jenis file batas input html

<!-- (IE 10+, Edge (EdgeHTML), Edge (Chromium), Chrome, Firefox 42+) -->
<input type="file" accept=".jpg,.png,.pdf" />
Friendly Hawk

Jenis Input Ukuran Batas File


// With Jquery 
$("#aFile_upload").on("change", function (e) {

    var count=1;
    var files = e.currentTarget.files; // puts all files into an array

    // call them as such; files[0].size will get you the file size of the 0th file
    for (var x in files) {

        var filesize = ((files[x].size/1024)/1024).toFixed(4); // MB

        if (files[x].name != "item" && typeof files[x].name != "undefined" && filesize <= 10) { 

            if (count > 1) {

                approvedHTML += ", "+files[x].name;
            }
            else {

                approvedHTML += files[x].name;
            }

            count++;
        }
    }
    $("#approvedFiles").val(approvedHTML);

});
M Hemel Hasan

Batas input Jenis File di HTML

<!-- Right approach: Use both file extensions and corresponding MIME-types. -->
<!-- (IE 10+, Edge (EdgeHTML), Edge (Chromium), Chrome, Firefox) -->
<input type="file"
 accept=".xls,.xlsx, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" /> 
Ankur

Jawaban yang mirip dengan “Jenis Input Ukuran Batas File”

Pertanyaan yang mirip dengan “Jenis Input Ukuran Batas File”

Lebih banyak jawaban terkait untuk “Jenis Input Ukuran Batas File” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya