Hi there,
I'm writing a plugin that should allow a user to insert a file (plain text or html) into the editor. The file is supposed to be on the user computer, so that it does not have to be uploaded to the server. Even more, I do not need this file on the server.
I've written the following code
CKEDITOR.dialog.add('uploadDialog', function(editor) { return { title: editor.lang.common.upload, minWidth: 250, minHeight: 100, contents: [{ id: 'uploadTab', elements: [{ type: 'file', id: 'fileName' }] }], onOk: function() { var filePath = this.getValueOf('uploadTab', 'fileName'); console.log(filePath); } }; });
and it sort of works, but:
- the variable filePath gets equal to the file name, not to the complete path to the file.
- I do not know how to get the content of the file in order to insert it into the browser.
If you could give some hint, it would be great!