Issue #3376Opened April 1, 2021by rcloss3 reactions

Changing upload URL for AssetManager programmatically

Question

I've got an situation where depending on how the Asset Manager is opened I want to pass a slightly different upload URL.

In the asset:upload:start event I have it looking to see which upload URL it should use, and if I have to change it I'm doing the

amConfig = editorAssetManager.getConfig() amConfig.upload = 'NEW URL'

but it's not using the new URL for the upload it sticks with the one defined on init. Is there way to update the config once grapesjs has been loaded? I don't see a set or a setConfig anywhere

Answers (3)

SzaboGabeszMay 30, 20233 reactions

editor.AssetManager.config.upload = 'NEW_URL' will do it

Ju99ernautApril 3, 20210 reactions

The value in config is only used during init so changing it does nothing, maybe changing these might help:

editor.Assets.FileUploader().config.upload = 'NEW_URL';
editor.Assets.AssetsView().config.upload = 'NEW_URL'
rclossApril 6, 20210 reactions

Thanks, just tried both of those, but no luck, at least in the asset:upload:start event

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.