Set TargetFolder

4 posts, 0 answers
  1. Paul
    Paul avatar
    3 posts
    Member since:
    Aug 2011

    Posted 23 Aug 2011 Link to this post

    Is it possible to set the TargetFolder property in the UploadHandler on the server side?

    Thanks,
    Paul.
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 25 Aug 2011 Link to this post

    Hi Paul,

    Yes, this is possible. The RadUploadHandler has virtual properties TargetFolder and TargetPhysicalFolder which you can override and set on the server side.

    Best wishes,
    Alex Fidanov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Paul
    Paul avatar
    3 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2011 Link to this post

    Where exactly can I set TargetFolder on the server side? I have had to override the GetTargetFolder method and set my folder here, however this seems to be called every time a chunk of data is posted, I want to set the target folder only once i.e. when the first chunk of data is transferred.

    Thanks,
    Paul.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 31 Aug 2011 Link to this post

    Hello Paul,

     You just have to override the TargetFolder (or TargetPhysicalFolder) in the UploadHandler class in your web project like so:

    namespace UploadHandler.Web
    {
        /// <summary>
        /// Summary description for UploadHandler
        /// </summary>
        public class UploadHandler : RadUploadHandler
        {
     
            public override string TargetFolder
            {
                get
                {
                    return base.TargetFolder;
                }
                set
                {
                    base.TargetFolder = value;
                }
            }
     
            
        }
    }
    Then you can change the setter and getter as you want. Let us know if you need further assistance.

    All the best, Petar Mladenov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top