Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sebastian Dammark 583 posts 1407 karma points
    Apr 04, 2016 @ 07:57
    Sebastian Dammark
    0

    Changing the upload path in Forms, when using UmbracoFileSystemProviders.Azure ?

    Is it possible to change the upload path for Forms ?

    My problem is that I'm using UmbracoFileSystemProviders.Azure to all ,y media files. But that doesn't play nicely with Forms who apparently dumps the files "locally" and not in the Azure cloud.

    So when I try to access the files uploaded through forms in "/media/forms", I get a 404 since my Azure cloud container is named "media"

    So my thoughts are to change the upload path for forms, if it's possible ? Or are there other solutions to my problem ?

    Thanx in advance

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Apr 04, 2016 @ 08:23
    Dennis Adolfi
    0

    Hi Sebastian.

    In Umbraco Forms config file, (App_Plugins/UmbracoForms.config) there is a config for UploadStorageDirectory. However, this seems to be a issue with Forms not minding this config. Se link: http://issues.umbraco.org/issue/CON-797.

    I tried this config but it still does´nt work. Maybe you should upvote this issue so it get priority.

    However you seem to be able to set the upload directory programmatically. What i did is i created a ApplicationStartupEvent and set the directory this way and this works:

    public class ApplicationStartup : ApplicationEventHandler
        {
            protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
            {
                // Set Umbraco Forms Upload Directory programmatically.
                Umbraco.Forms.Core.Configuration.UploadPath = "/CustomFolder";
            }
        }
    

    enter image description here

    Hope this helps you!

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Apr 04, 2016 @ 10:56
    Dennis Adolfi
    0

    Saw that you upvoted the issue and commented on http://issues.umbraco.org/issue/CON-797, great! :)

    Did you try the ApplicationStartup soultion? Interested if this works for you on Azure. (I dont have a Azure account to try with and it might be good for others to know if it works.)

Please Sign in or register to post replies

Write your reply to:

Draft