Search
 
SCRIPT & CODE EXAMPLE
 

HTML

input limit file type html

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

input type file limit size


// 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);

});
Comment

file type input limit in 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" /> 
Comment

PREVIOUS NEXT
Code Example
Html :: markdown: text alignment and size 
Html :: flutter html to pdf 
Html :: laravel blade @checked 
Html :: mailto subject 
Html :: angularjs href variable 
Html :: bootstrap 4 tooltip 
Html :: html fieldset color background 
Html :: html 
Html :: twig default 
Html :: como cambiar la fuente de letra en html 
Html :: bootstrap align right button 
Html :: how to write floating point numbers in html5 input 
Html :: javascript delay button 
Html :: how to get rid how white border on html page 
Html :: input text expand to fit content 
Html :: write html inside component angular 
Html :: how to add a link to an image in html 
Html :: html escape quote in atribute 
Html :: display html input datetime-local value 
Html :: html.erb conditionally add class 
Html :: html multiply 
Html :: how to add two radio button in html 
Html :: display image in twig 
Html :: how to make new line in html paragraph 
Html :: working search bar html 
Html :: form validation using html/css/js 
Html :: pass data from blade/laravel to vue 
Html :: Resize the image in jupyter notebook 
Html :: base64 image in html 
Html :: bootstrap 5 list 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =