Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Using relative paths to media uploaded to the Gallery

oliver_huber
7 - Meteor

Hi,

 

we use the districts within the Gallery to add html content. Doing that, we also reference media (pdf files, images etc.) uploaded prior into the "media" section via the Gallery admin login before. This obviously only works by using absolute paths (https://our-gallery/api/media/xxxx/my_image.png).

 

We use a staging environment to build out the gallery including the districts; later, we move everything to production. As staging and production do have different sub-domains, we have to change the absolute paths one by one manually, which is a nuisance.

 

Is there a way of either using relative paths or to automate the change of the absolute paths in the html of the districts?

 

Thanks,

 

Oliver

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus
You also might consider a user constant with the paths defined. Then you can use formulas to update the path depending on staging or production.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
oliver_huber
7 - Meteor

Can I actually use a workflow to update the content of the districts in the Gallery? If so, how would I do that? So far I am only aware of the process of logging in as an admin and edit the content manually:

 

Untitled.png

oliver_huber
7 - Meteor

I haven't found a solution to automate changing the existing links. However, I found something that prevents me from getting into this situation in the future in the first place:

 

Adding hyperlinks using the appropriate icon from the GUI toolbar results in an absolute path for this link (even for content that is already uploadad as "media" to the Alteryx server).

 

In order to get around that, one has to click on "source code" in order to edit the links directly.

 

Doing so, one should define the URL as relative to the root folder of the Gallery, e.g., "/api/media/ ..." The first forward slash is important in that case!