summernote-file
Summernote plugin to insert files by URL or file upload.
Based on the summernote-audio plugin.
It can handle picture files (jpg, png, gif, wvg, webp), audio files (mp3, ogg, oga), and video files (mp4, ogv, webm) without any upload, in base64.
You can also define your own handle in order to upload these files, and any other type of file into your server, and render them in Summernote.
Classic use
Include the plugin script after including Summernote:
<!-- include jquery, bootstrap, summernote here -->
NPM
You can add summernote-file in your project with using npm : npm i summernote-file
Configuration
Add the file button to the Summernote toolbar:
;
File type
By default, the plugin can handle picture, audio, and video files, in base64. In order to handle all type of files, you have to implement the "onFileUpload" callback for uploading them into you server :
;
Callback exemple for uploading
Here is an exemple of the callback (with upload progress handling) :
; { let data = ; data; $;} { if elengthComputable //Log current progress console; //Reset progress on complete if eloaded === etotal console; }
Translations
Currently supports the following languages:
- English
- French