Skip to content

impulsgraw/AL.MultipleFile.JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

AL.MultipleFile.JS

Allows to call html input file dialogue from any html element and dynamically add files to html form. Written in native JavaScript+JQuery with no Flash or other third-party libraries.

Requirements

Requires jQuery library

Usage

Simply connect al.multiplefile.*.js after jQuery, then bind it on any DOM object (for ex. button):

$('.btn').multipleFile({
		maxFiles: 4, //files limit
		accept: '.doc,.docx', //accepting extensions
		maxFileSize: 5*1024*1024, //max file size
		onInitSuccess: function(){ //called when mltipleFiles initialized
			console.log('MultipleFile plugin initialized successfully!');
		},
});

This code creates an instance of multipleFile on .btn object, sets the files limit up to 4 (maximal file size of each not higher than 5*1024*1024 bytes) and acceptable extensions to .doc and .docx. You can also use MIME-types of acceptable file extensions in the same context (combining simplified file extensions with MIME-types, e.g. accept: 'image/png,.jpg' - makes differences in different browsers).

About

Allows to call html input file dialogue with any html element and add files to form in native JavaScript

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors