Skip to content

pure js ajax uploader using fetch api, drag-n-drop multi-file

Notifications You must be signed in to change notification settings

uitr-lab/js-ajax-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-ajax-uploader

Add file drop listener to page and/or page elements and upload files to your upload handler ie: /your/upload

Simple Usage

<script src="dist/file.js"></script>
	var dropTarget= (new FileDropTarget(document.body, {
	    url:"/your/upload/handler",
	    data:{
	        shareName:"extra-data" //extra data to send to server 
	    }
	})).on('progress',(progress)=>{
		
		
	}).on('upload', (results) =>{
	    // update UI
	});
	
	
	
	
	
	//...
	
	
	// You can also re-use the uploader to upload directly from input element
	// <input type="file" name="" onchange="dropTarget.uploadFiles(this.files, this);" />
	
  • Supports multiple drop handler targets on a single page
  • Target elements or css selectors
  • Supports nested drop handler targets (ie folder/sub-folder structure)

About

pure js ajax uploader using fetch api, drag-n-drop multi-file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published