Issue #985💬 AnsweredOpened March 29, 2018by tomichal1 reactions

Can GrapesJS allow uploading arbitrary file through the built in asset manager?

Quick answerby artf1

Good question, I think the issue is the OpenAssets command itself that should be renamed in OpenImageAssets (indeed it renders only images types). So, what you can try to do is to create another command (eg. a more generic one or just for documents) and see if the customization works out for you. If you will see any p...

Read full answer below ↓

Question

I looked at the asset manager code as well as the wiki and it seems like despite the docs claiming that the asset manager can handle uploading arbitrary files (i.e. by adding an arbitrary asset type), the actual asset manager code hardcodes file type image/* on the file input field of the file upload form https://github.com/artf/grapesjs/blob/d5f0ae94dfd801a8c13cc0f6ce33e209f98f1c65/src/asset_manager/view/FileUploader.js#L8 Is this a bug/oversight and indeed the asset manager code needs to be modified/hacked, or am I missing a way to configure the manager to accept the file types matching the...

Answers (3)

artfMarch 31, 2018

Good question, I think the issue is the OpenAssets command itself that should be renamed in OpenImageAssets (indeed it renders only images types). So, what you can try to do is to create another command (eg. a more generic one or just for documents) and see if the customization works out for you. I...

tomichalApril 10, 2018

@artf I created the referenced pull request. I admit my motivation was my specific use case, but hopefully it was coded generically enough to be acceptable in the core editor codebase.

tomichalApril 10, 2018

... oh and just to clarify - another chunk of code written alongside this pull request resides in a custom plugin of my project. It's a plugin that essentially does the following:Customises the Link DOM component such that upon creating a link via the RTE, the asset manager opens up at which point...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.