Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Accessing files with correct extensions View modes: 
User avatar
Member
Member
trint.ladd@altn.com - 1/5/2012 3:27:18 PM
   
Accessing files with correct extensions
We're running Kentico CMS 6.0 in Portal mode starting from a blank site template.

On our website we have many files of various types that need to be accessed directly. PDF, JPEG, TXT, etc. These files will usually be added to the content tree and published to the live site via content staging. Occasionally, they will be uploaded in mass with the file uploader.

We need for these files to be accessible by their correct file names, with correct file extensions. I have tried several methods to achieve this based on forum posts and the developers guide with varying degrees of success.

We can not "Use custom URL extensions" on every file as this would be difficult to maintain for the number of files involved.
(http://devnet.kentico.com/docs/devguide/index.html?configuration_of_custom_url_extensions.htm)

We would prefer not to edit the "Custom Errors" entries in IIS as it could add complexity to our site deployment and invite mistakes.
(http://devnet.kentico.com/docs/devguide/index.html?custom_url_extensions_iis6.htm)

To support SEO and legacy URLs from previous incarnations of our site, we must have "Friendly URL Extensions" set to a single forward slash ("/").
(http://devnet.kentico.com/Forums.aspx?forumid=45&threadid=21983,
http://devnet.kentico.com/docs/devguide/index.html?configuration_of_extensionless_urls.htm)

So, what is the best practice for supporting files with correct extensions without doing file property changes and without editing the IIS Custom Errors entries?

Thanks,
Trint

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/5/2012 10:55:18 PM
   
RE:Accessing files with correct extensions
Hello,

You can manage the "Use custom URL extensions" via code during the document creation, if you can't use the other approaches. So, you will have to create some custom code. The extensions are saved in the CMS_Document table, column DocumentExtensions. The code can be executed with an event handler, for example you can use the OnAfterUpdate event of the TreeNode handler.

Best regards,
Boris Pocatko