Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1347 posts 1608 karma points
    Mar 16, 2016 @ 22:25
    Gordon Saxby
    0

    Add file upload to custom section

    I am creating a custom section and want to allow users to drop a file onto the section dashboard to upload it - in the same way that you can in the Media Library section.

    Rather than actually uploading to the media library, I will need to process the files as they contain data to be uploaded.

    I have created the new section and have a blank dashboard showing - but I don't know how to implement the "drag - drop - upload" bit!

    Any clues / pointers / etc would be most welcome!

  • Dave Woestenborghs 3325 posts 11170 karma points MVP 5x admin c-trib
    Mar 17, 2016 @ 07:07
    Dave Woestenborghs
    0

    Hi Gordon,

    Haven't done this myself, but maybe this gist by Kyle Weems can help you out : https://gist.github.com/cssquirrel/3e5daad14bd2ff40edcc

    Dave

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 18, 2016 @ 16:51
    Gordon Saxby
    0

    Umm, struggling to get it plumbed in and working :-(

    I have "App_Plugins/MyPlugin/BackOffice/MyPluginTree' folder where I put the file upload files.

    I added the upload menu like this:

    var m = new MenuItem("fileUpload", "Upload File") {Icon = "wine-glass"};
    

    There is a file called fileUpload.html, which does load. however, I get the error:

    Argument 'FileUploadController' is not a function

    which means little to me. Anyone know what the problem might be? Has anyone successfully used this code by Kyle Weems?

  • Kyle Weems 42 posts 296 karma points MVP 4x c-trib
    Mar 21, 2016 @ 15:01
    Kyle Weems
    0

    Gordon,

    Is this a JS error, or a C# error? And when in the process does the error occur?

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 21, 2016 @ 15:10
    Gordon Saxby
    0

    A JS error ... happens when the page loads. I see the error in the console window in Chrome.

    My (the possible) problem is that I am new to Angularjs and cannot be sure I have put everything in the right place and configured everything that is needed.

  • Kyle Weems 42 posts 296 karma points MVP 4x c-trib
    Mar 21, 2016 @ 15:24
    Kyle Weems
    0

    OK, my next question was your Angular experience. :)

    If I had to guess without seeing your code, I'm guessing that you're trying to load the angular view in the back-office, but haven't linked to the controller in it. My example code is for a file upload function on the front of a website, and the markup acts accordingly.

    The error sounds like it's trying to load the controller that's bound to the HTML view, but is failing to locate it.

  • Kyle Weems 42 posts 296 karma points MVP 4x c-trib
    Mar 21, 2016 @ 15:25
    Kyle Weems
    0

    Can you post your relevant code snippets?

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 23, 2016 @ 13:22
    Gordon Saxby
    0

    I have posted various code snippets below - is there anything else that would be helpful to see?

  • David Brendel 786 posts 2949 karma points c-trib
    Mar 21, 2016 @ 15:28
    David Brendel
    0

    Hi,

    the error seems like the controller is not added in the package manifest and thus not loaded by umbraco.

    Regards David

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 21, 2016 @ 15:32
    Gordon Saxby
    0

    I will do so, but in a couple of hours as I am not at my own computer at the moment.

    I initially tried adding a node menu item and then tried to add it as a dashboard page. The same problem happened with both solutions.

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 21, 2016 @ 18:40
    Gordon Saxby
    0

    OK, I have added a folder structure as

    App_Plugins/MyPlugin/BackOfficeMyPluginTree

    I have added a package.manifest to the folder App_Plugins/MyPlugin

    {
    javascript: [
    '~/App_Plugins/MyPlugin/BackOffice/ng.app.js',
    '~/App_Plugins/MyPlugin/BackOffice/file.upload.controller.js',
    '~/App_Plugins/MyPlugin/BackOffice/angular-file-upload.js',
    '~/App_Plugins/MyPlugin/BackOffice/file.upload.api.service.js'
    ]
    

    }

    I have added the following to dashvoard.config

      <section alias="MyPlugin">
    <areas>
      <area>myplugin</area>
    </areas>
    <tab caption="Upload Files">
      <control showOnce="false" addPanel="true" panelCaption="">
        /App_Plugins/MyPlugin/backoffice/fileUpload.html
      </control>
    </tab>
    

    I have added the following files to the "backoffice" folder:

    angular-file-upload.js (version 3.2.3) file.upload.api.service.js file.upload.controller.js fileUpload.html ng.app.js

    Is there anything else you need to know / see

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 24, 2016 @ 17:54
    Gordon Saxby
    0

    Can anyone help with this? I just can't get it to work - or find any useful examples / tutorials :-(

  • Gordon Saxby 1347 posts 1608 karma points
    Mar 29, 2016 @ 21:51
    Gordon Saxby
    0

    Still getting nowhere :-(

    Time to abandon this idea and find another way to upload files.

  • Bendik Engebretsen 105 posts 198 karma points
    Nov 02, 2016 @ 20:47
    Bendik Engebretsen
    0

    If someone still struggles with this, I have just got it working:-) My receipe is here.

  • 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