Copied to clipboard

Flag this post as spam?

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


  • Amigo 245 posts 600 karma points
    Jul 23, 2023 @ 16:15
    Amigo
    0

    Custom upload code for Umbraco Form upload

    Can I somehow create some custom code for a file upload in Umbraco forms?

    What I need is to save uploaded videos to a 3 party and create a content page etc. when user is uploading a video.

    /Thomas

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Jul 23, 2023 @ 20:05
    Marc Goodson
    100

    Hi Amigo

    I think you could create a custom Workflow Type

    You'd then add this to the Workflow steps of your custom form

    Inside the Workflow Type you would have access to the submitted record data:

    https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-workflowtype

    I'm not super sure how that would be for an uploaded file, whether you'd have access to the upload stream or to a path to where the file has been saved, but I guess once you have a custom workflow up and running, you could set a breakpoint and see what you have access to.

    Then inside your Workflow, you can make a request to send the file to your third party endpoint, and then create a content page, or maybe have that as a separate workflow step etc.

    regards

    Marc

  • Amigo 245 posts 600 karma points
    Jul 24, 2023 @ 22:32
    Amigo
    0

    Hi Marc,

    Cool, I will take a look at that. I was thinking about posting the xml to an API url, but your solution sounds better I guess ;-)

  • Amigo 245 posts 600 karma points
    Jul 26, 2023 @ 14:51
    Amigo
    0

    Works like a charm, thank you Marc

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies