Awesome
Media Manager
Media Manager is an open source web file manager and can be a nice alternative to Wordpress Media Manager, CKFinder, KCFinder, elFinder... It is still in its early stages, but feel free to use it, report bugs and contribute.
This project use Javascript and :
Demo
https://www.iutbayonne.univ-pau.fr/~klevron/mm/
Features
- Backends (by using flysystem) :
- Local
- FTP
- SFTP
- ...
- Drag&drop file upload
- Multiple file upload
- Image preview
- Input option
- Multilanguage
- File actions :
- Details
- Download
- Rename / Move
- Delete
- Folder actions :
- Details
- Download
- Rename / Move
- Delete
- Context menu
- vuejs component
- npm package
- Integration :
- CKEditor plugin
- TinyMCE plugin
- Drupal module
Install
Client
<link href="mm.min.css" rel="stylesheet">
...
<script src="mm.min.js"></script>
Server
Media Manager is a client side tool, it will display files located on a server, it needs a web service to communicate with :
Usage
HTML
<div id="media-manager"></div>
JavaScript
new MM({
el: '#media-manager',
api: {
baseUrl: 'https://server.com/api/',
listUrl: 'list',
downloadUrl: 'download', // optional
uploadUrl: 'upload', // optional
deleteUrl: 'delete' // optional
}
});
With input
HTML
<input type="text" id="file-input">
<div id="media-manager"></div>
JavaScript
new MM({
el: '#media-manager',
api: {
baseUrl: 'https://server.com/api/',
listUrl: 'list'
},
input: {
el: '#file-input',
multiple: false
}
});
Options
el
- Type : String
- Details : CSS selector string.
basePath
- Type : String
- Default : ""
- Details : Base path with a trailing slash, e.g. "folder/".
api
- Type : Object
- Details : API Config.
api.baseUrl
- Type : String
- Default : null
api.listUrl
- Type : String
- Default : null
api.downloadUrl
- Type : String
- Default : null
api.uploadUrl
- Type : String
- Default : null
api.options
- Type : Object
- Default : {}
- Details : Will be used to create an axios instance.
input
- Type : Object
- Default : false
- Details : Input config.
input.el
- Type : String
- Details : CSS selector string.
input.multiple
- Type : Boolean
selected
- Type : String|array
- Details : Selected medias.
onSelect(event)
- Type : function
- Details : Select callback, use
event.selected
to get selected files.
showBreadcrumb
- Type : Boolean
- Default : true
height
- Type : String
- Default : null
- Details : Use this if you want a fixed height, e.g. '600px'.