Try our conversational search powered by Generative AI!

Path to uploaded documents in episerver

Vote:
 

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:
/contentassets/ec231023da3a4ea695dc3a09987io38f/i-love-cats.png

if these a way change this to be instead encoded like:
/contentassets/ec231023da3a4ea695dc3a09987io38f/i%20love%20cats.png

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

#200839
Jan 28, 2019 10:35
Vote:
 

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

#200858
Jan 29, 2019 8:56
Vote:
 

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

Check out IUrlSegmentCreator

http://www.abunchofcode.com/remove-multiple-dashes-in-episerver-automatic-generated-urls/

BR

#200864
Jan 29, 2019 15:50
Vote:
 

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

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

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