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

Forums / General Discussions / Files provider upload path

Files provider upload path

5 posts, 1 answered
  1. Chris
    Chris avatar
    87 posts
    Registered:
    11 May 2010
    08 Sep 2010
    Link to this post
    Hi,

    I have switched my Site Finity site to save images on disk but is it possible to change the path of files uploaded to a library from /AppData/Files?

    Thanks,

    Chris.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Sep 2010
    Link to this post
    Hello Chris,

    You have to create a custom class that inherits from FileSystemProvider. There is a public virtual property BasePath that you can override and change the path location.

    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
  3. Chris
    Chris avatar
    87 posts
    Registered:
    11 May 2010
    08 Sep 2010
    Link to this post
    Ok, that sounds easy enough. Do I need to configure something in web.config to use the new provider?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Sep 2010
    Link to this post
    Hi Chris,

    You should also override Telerik.Libraries.Data.DefaultProvider where you initialize your own FileSystem provider by overriding AvailableStreamingProviders.

    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
    Answered
  5. Chris
    Chris avatar
    87 posts
    Registered:
    11 May 2010
    10 Sep 2010
    Link to this post
    Thanks Ivan. I have this working now.

    Here is the code for overriding AvailableStreamingProviders in case anyone else needs it.

    public override System.Collections.Generic.IDictionary<string, Telerik.Cms.Engine.Streaming.IStreamingContentProvider> AvailableStreamingProviders
    {
     get
     {
        base.AvailableStreamingProviders["Files"] = new MyFileSystemProvider(this);
        return base.AvailableStreamingProviders;
     }
    }

Register for webinar
5 posts, 1 answered