Skip to content

This project is a simple file manager for a phonegap application I am building.

Notifications You must be signed in to change notification settings

ibrahimAboelsuod/phonegap-js-filemanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

phonegap-js-filemanager

(WIP)This project is a simple file manager for a phonegap application I am building.

It's originally ment for cordova based apps.

But it should work just fine with any web based app sence it's based on the W3C File API.

........................................................

Simple docs:

- To scan for a files of predefind type:
	1- Create an object of the file manager class
	
		Code:
			var fm=new fileManager();
		
	2- Call scanDisk -Inside of deviceready if you are using cordova-
	
		fileManager.scanDisk(RootDirectory: string, typeList: array of strings, domain: string);
		Notce that:
			-typeList is not case sensitive
			-domain is an optional fix and might not be required depending on your code
		Code:
			fm.scanDisk(cordova.file.externalRootDirectory, ["png","jpg","jpeg","gif"], "file:///storage/sdcard0", function(entries){
				//use entries
			});
	
	3- Read scaned files, this meathode is not exactly pretty but it will do for now (will be changed soon)
		YOU DONT HAVE TO USE THIS METHODE ANYMORE, just use the callback in scanDisk function.
	
		Code:
			var timerId=setInterval(function(){
				if(fm.scanDiskFiles != null){
					var files=fm.scanDiskFiles;
					clearInterval(timerId);
				}
			}, 500);

About

This project is a simple file manager for a phonegap application I am building.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published