I would like to allow content editor to upload and link to various files as they need (pdf, zip, etc.).
It is easy and integrated for images in the default ckeditor. I would need the same, but for generic files.
There is no button I can add to ckeditor that can do this.

I know there is a files content tab.But no upload tool.

But what is the best way to easily upload a file (whatever it is) and link to it with drupal 8?
Thanks :)

Comments

nevets’s picture

I would use a file field instead of trying to upload to the body.

awasson’s picture

At the moment the best way I have found to add a file uploader to CKEdit in Drupal 8 appears to be accomplished by using the IMCE module (https://www.drupal.org/project/imce). The DEV version is currently more advanced than the release candidate so I would use that until it matures.

Once it's installed, you will find a second link icon and a second image icon in the options for configuring the CKEditor. The new link tool allows you to choose files from the file system, upload, create directories, etc... and the new image tool allows the same.

I use both the original link and image tools + the CKEdit advanced link tool (https://www.drupal.org/project/editor_advanced_link) so that I can use the features built into CKEdit as well as the extended use with IMCE.

I hope that helps.

Andrew

vladsocaciu’s picture

You can also use D8 Editor File upload with D8 Editor Advanced link. It provides a File button, similar to the Image button.