Issue #3376✓ SolvedOpened April 1, 2021by rcloss3 reactions

Changing upload URL for AssetManager programmatically

Quick answerby SzaboGabesz3

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

Read full answer below ↓

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 (4)

👍 Most helpfulSzaboGabeszMay 30, 2023

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

Ju99ernautApril 3, 2021

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, 2021

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

GJSBlockMay 17, 2026

Thanks for reporting this, @rcloss. Great question about Changing upload URL for AssetManager programmatically. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most o...

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.