Get Selected File

 

<script src="elfinder/js/elfinder.min.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="elfinder/css/elfinder.min.css">

 

	var options = {
		url : 'elfinder/php/connector.php', 
		handlers : {
			select : function(event, elfinderInstance) {
				var selected = event.data.selected;
				if(selected.length > 0){
					var file = elfinderInstance.file(selected[0]);
					console.log(file.name);//File name
					//console.log(elfinderInstance.path(selected[0]));
				}
			}
		}
	}

	var elfinder = $('div.fileexplorer').elfinder(options).elfinder('instance');

 

https://github.com/Studio-42/elFinder/issues/308

One thought on “Get Selected File

  1. We absolutely love your blog and find the majority of
    your post’s to be just what I’m looking for.
    Does one offer guest writers to write content for yourself?

    I wouldn’t mind publishing a post or elaborating on many of the subjects you write in relation to here. Again, awesome website!

Comments are closed.