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

Forums / Developing with Sitefinity / 3.7 SP4 Files Provider path and extension not working / mismatch

3.7 SP4 Files Provider path and extension not working / mismatch

6 posts, 0 answered
  1. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    29 Nov 2010
    Link to this post
    Hello,

    I've just enabled the Files provider on my 3.7 SP4 website as described in the Knowledge Base article here.

    I've also checked and double checked the relevent web.config settings.

    The problem is when I upload a new file via SF (whether documents, videos or images) they are saved to the path ~/App_Code/Files/Libraries directory with NO file extension (for example, ~/App_Code/Files/Libraries/a37cd261-8839-46de-a44a-b26f021b7a0f).

    However, in the Images & Documents module, and indeed when I add a new SF image (for example), the path is wrong (for example, ~/Libraries/Images/Test.jpg).

    I obviously need to paths to be correct, and also just as importantly I need to uploaded file to have the correct extension (as I use a custom video control).

    What can I do to fix this problem?

    Here are my relevent web.config entries:


            <cmsEngine defaultProvider="Generic_Content">
                <providers>
                    <clear/>
                    ...
                    <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"/>


                <libraryInfo>
                    <add name="Image" title="Image Library" defaultExtenstions=".png, .jpg, .jpeg, .gif" metaKeys="Author, AlternateText, Extension, Name, Height, Width, Size, Category"></add>
                    <add name="Document" title="Document Library" defaultExtenstions=".doc, .docx, .rtf, .txt, .pdf, .ppt, .pptx, .html, .xls, .xlsx" metaKeys="Author, Description, Extension, Name, Size, Category"></add>
                    <add name="Video" title="Video" defaultExtenstions=".avi, .wmv, .flv" metaKeys="Author, Extension, Name, Size, Category, Description"></add>


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

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Nov 2010
    Link to this post
    Hi nogatek,

    App_Data is just a storage for the content of a file you upload through the module. So instead of adding binary data to the database we are adding to App_Data folder
    How the links is formatted - based on urlRewriteFormat

    "~/{Provider}/{LibraryName}/[Name]{Extension}"

    As I can see your url is ~/Libraries/Images/Test.jpg

    Provider - Libraries
    LibraryName - Images
    Name - Test
    Extension - jpg


    Greetings,
    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
  3. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    29 Nov 2010
    Link to this post
    Thanks Ivan,

    Yes, SiteFinity renders the link as you explain - however, the image does not appear? (broken link).

    I can see the image file is uploaded too ~/App_Code/Files/Libraries/a37cd261-8839-46de-a44a-b26f021b7a0f

    There seems to be a mismatch here?

    None of image, document or videos are working.

    Regards,

    Mark
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Nov 2010
    Link to this post
    Hi nogatek,

    Have you added handler mappings in IIS for the extensions your are going to use? If no you should add them, otherwise request for *.jpg, .*png etc cannot be processed.

    Best wishes,
    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
  5. nogatek
    nogatek avatar
    35 posts
    Registered:
    23 Apr 2008
    29 Nov 2010
    Link to this post
    Hello Ivan,

    I was starting to wonder about this. I will try it this evening, thank you.

    However, I really wanted the files to be stored with the correct file extension written to disk (so my custom content controls will keep working). Is there a way I can force this somehow?

    Thanks,

    Mark
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Nov 2010
    Link to this post
    Hello nogatek,

    Our provider stored only the content data. If you want to get the actual object you can just migrate your files to the file system

    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
Register for webinar
6 posts, 0 answered