+1-888-365-2779
Try Now
More in this section

Forums / Deployment / Questions on "How to use real extensions" KB Article

Questions on "How to use real extensions" KB Article

10 posts, 1 answered
  1. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    09 Oct 2009
    Link to this post
    I'm trying to use the 3.6 method of extension mapping and can't get it working. There are a few things that are unclear in the KB article that might be the problem.

    From the article:

    Note: The defaultExtension attribute's value must be set to the old extension from the urlRewriteFormat attribute (see step 2).


    Are you saying that an Image Library should always have a default extension of ".sflb.ashx"? 

    Step 4 talks about a "Configuring IIS" section in the User Manual. I don't see a section like that.

    The IIS mapping part sounds like my problem. I'm on IIS 5.1 (XP Pro). The preview page in the Image Library uses the jpg file instead of sflb.ashx. But the preview page can't display it because pulling up the jpg causes a 404.

    Thanks,
    Jeff
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Oct 2009
    Link to this post
    Hi Jeff,

    As I see it step 3 refers to the defaultExtension. There you need to set the default extension for the Libraries provider - sflb.asxh, since you will have {Extension} for the provider ( as described in step 2);

    As for the step 4 - you need to add handler mappings  under IIS for jpg and other extensions ( say png, gif etc).

       1. From the Start menu, right-click Computer, then click Manage.
       2. Expand Services and Applications, Internet Information Services.
       3. Right-click Web Sites and select Properties.
       4. On the Home Directory tab, click Configuration.
       5. Map the file extension
             1. Click Add.

             2. In the Add/Edit Application Extension Mapping dialog box, click Browse.

             3. Browse to the folder that contains the aspnet_isapi.dll, select the file, then click Open.

             4. Specify .jpg as the extension.

             5. Make sure Check that file exists is unchecked.

             6. Click OK, and OK again to return to the Web Sites Properties dialog box.

       6. Click OK to close the dialog box.

    I hope this helps.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    12 Oct 2009
    Link to this post
    Thanks Ivan. Adding the extension to IIS did the trick.

    It would help others out if you added these steps to the KB article.

    Jeff
  4. Brian
    Brian avatar
    3 posts
    Registered:
    17 Apr 2007
    11 Mar 2010
    Link to this post
    I am trying to get the real file extensions working as well, but I am not having much luck.  I have followed the original KB article as well as this post and I am still not able to see any of the images I upload to the images and documents module.

    Any help would be greatly appreciated as I am evaluating this product (version 3.7).

    I should note that I am running IIS 6 on Windows XP.

    Brian
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Mar 2010
    Link to this post
    Hi Brian,

    There should not be a problem with the KB. It works correctly. Make sure that you have followed all steps correctly. Try to remove the images from the module and upload them - or do it only for a single library. There is also another KB that explains different way to get real extensions - How to filter the default ContentHttpHandler by extension

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Brian
    Brian avatar
    3 posts
    Registered:
    17 Apr 2007
    11 Mar 2010
    Link to this post
    Ivan,

    I've been working on this issue for nearly two days.  I've read and re-read the KB article.  I've added the mappings to IIS, restarted IIS, removed all of the images from the library I created and re-uploaded them.  The only difference I am seeing is the extension of the file I've uploaded (instead of .sflb.ashx it's showing .jpg).  I still get the 404 error when attempting to view the original and I'm also receiving the red x in place of the image in the image library.

    Any other thoughts?

    Below are the changes I made to the web.config (corresponding to the steps in the KB).  Perhaps you will see something.

    STEP 1: Modules

        <modules>
          <remove name="ScriptModule" />
          <remove name="Cms" />
          <remove name="LibraryModule"/>
          <remove name="RadUploadModule" />
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="Cms" type="Telerik.Cms.Web.CmsHttpModule, Telerik.Cms" />
          <!-- Http Module for extension mappings in Library module.-->
          <add name="LibraryModule" type="Telerik.Libraries.LibraryHttpModule, Telerik.Libraries"/>
          <add name="RadUploadModule" preCondition="managedHandler" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
        </modules>

    STEP 1: httpModules

        <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="Cms" type="Telerik.Cms.Web.CmsHttpModule, Telerik.Cms" />
          <!-- Http Module for extension mappings in Library module.-->
          <add name="LibraryModule" type="Telerik.Libraries.LibraryHttpModule, Telerik.Libraries"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
        </httpModules>

    STEP 2:

        <cmsEngine defaultProvider="Generic_Content">
          <providers>
            <clear />
            <add name="Generic_Content" urlRewriteFormat="[Publication_Date]/[Name].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="False" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" />
            <add name="News" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/News" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data" />
            <add name="Blogs" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" applicationName="/Blogs" allowVersioning="True" allowComments="true" commentsModeration="false" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Blogs.Data.DefaultBlogProvider, Telerik.Blogs.Data" />
    <!--        <add name="Libraries" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].sflb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" /> -->
            <add name="Libraries" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name]{Extension}" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />
            <!--Amazon Data Provider [First turn off the default one] url format can be urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].s3lb" as well in that cae there will extra libraries in the url-->
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].s3lb"  thumbnailExtension=".tmb" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.AmazonProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />-->
            <!--Viddler Data Provider Compatible with other libraries, must add a libraryInfo with type = "Viddler"-->
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].sflb.ashx" thumbnailExtension=".tmb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.ViddlerProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx"/>-->
            <add name="Events" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/Events" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Events.Data.DefaultEventsProvider, Telerik.Events.Data" />
            <add name="Wiki" urlRewriteFormat="[Wiki]/[Name].aspx" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" securityProviderName="" allowVersioning="True" applicationName="/Wiki" versioningProviderName="" allowComments="true" commentsModeration="true" connectionStringName="GenericContentConnection" dataFile="~/App_Data/Wikis.xml" type="Telerik.Wiki.Data.XmlProvider, Telerik.Wiki.Data" />
          </providers>

    STEP 3:

          <extensionMapping defaultExtension=".sflb.ashx">
            <add key=".jpg"/>
            <add key=".gif"/>
            <add key=".doc"/>
     <add key=".pdf"/>
     <add key=".csv"/>
     <add key=".xls"/>
          </extensionMapping>


  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    15 Mar 2010
    Link to this post
    Hello Brian,

    Make sure that you have added the handler mappings. Try adding Wildcard ScriptMap as well. The only reason for getting 404 is when the request is not processed by the handler.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    26 May 2010
    Link to this post
    Is there a way to "automagically" update all your old URLs to use the proper file extension?  I've just upgraded to 3.7 SP3 from 3.2 SP1 and all new links work perfectly, but the old ones still point to .sflb.

    J
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    26 May 2010
    Link to this post
    Hello Jason M,

    You could use ReplaceTool - Globally replace everything in your project with zero efforts
    or create a custom tool that will replace the old links in your content.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    26 May 2010
    Link to this post
    Brilliant!  Thanks Ivan.

    J
Register for webinar
10 posts, 1 answered