API Questions on Kentico API.
Version 5.x > API > File extensions in Media Library View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 11/29/2011 4:05:20 PM
   
File extensions in Media Library
I am using Kentico 5.5 with the build 5.5.4237 R2 and I was wondering:

Is it possible with the "Insert/Edit image or media" in the FCKEditor to return the image with its extension? Currently, everything I select a file from the Media Library, it returns a .aspx URL. However, I am currently running a javascript that adds a class depending on the type of the file. For example, .pdf would show a PDF icon besides the link, .doc would show a DOC icon besides it, and etc. Currently, the script does not work because there is no way to distinguish the type of the file with the current URL structure.

Is there a way to show the extension in a Media Library document/image so that I can use my javascript to get that value?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/5/2011 5:32:34 AM
   
RE:File extensions in Media Library
Hi,

you can check setting "Use permanent URLs" in Media settings (Site Manager - Settings - Media Libraries (or Content - Media in the version 6.0). With this enabled, file extensions are rendered.

Best regards,
Ivana Tomanickova

User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 12/6/2011 8:34:31 AM
   
RE:File extensions in Media Library
Thank you! This worked like a charm!

User avatar
Guest
prem - 4/3/2012 4:30:16 AM
   
RE:File extensions in Media Library
Nathoushka wrote: Thank you! This worked like a charm!


User avatar
Guest
test - 4/3/2012 4:28:53 AM
   
RE:File extensions in Media Library
Nathoushka wrote: I am using Kentico 5.5 with the build 5.5.4237 R2 and I was wondering:

Is it possible with the "Insert/Edit image or media" in the FCKEditor to return the image with its extension? Currently, everything I select a file from the Media Library, it returns a .aspx URL. However, I am currently running a javascript that adds a class depending on the type of the file. For example, .pdf would show a PDF icon besides the link, .doc would show a DOC icon besides it, and etc. Currently, the script does not work because there is no way to distinguish the type of the file with the current URL structure.

Is there a way to show the extension in a Media Library document/image so that I can use my javascript to get that value?