Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Path to uploaded documents in episerver


This might be a easy question :)

When uploading a document for a specific page lets say its a image with name "i love cats.png"

the link to the image will be something like this:

if these a way change this to be instead encoded like:

Is these a setting for this somewhere that i cannot find :)?

Jan 28, 2019 10:35

just out of curiosity - why you want to encode the link like that?

Jan 29, 2019 8:56

Hej Pawel , Yes, why would you do that ;)

Check out IUrlSegmentCreator


Jan 29, 2019 15:50

We have a customer that are uploading (files) reports that are htm files these files are linking to other htm files within the same folder and the links have "space" in them. 

Episerver rewrites the uploaded documents and replaces space with "-" 

The solution i made instead is a rewrite rule that kicks in when the click on a link within the htm report that have space in it.

  <rule name="ReplaceContentassetsLinks" stopProcessing="true">
<match url="^contentassets/(.*) (.*)" />
<action type="Redirect" url="contentassets/{R:1}-{R:2}" />
<rule name="ReplaceGlobalassetsLinks" stopProcessing="true">
<match url="^globalassets/(.*) (.*)" />
<action type="Redirect" url="globalassets/{R:1}-{R:2}" />

worth to mention, its a site migrated from anotother old platform and customer is migrating to a more modern reporting system meaning these htm files will live for 6 months.. ish.. :)

Feb 12, 2019 8:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.