Angular drag and drop with upload

3 posts, 0 answers
  1. flexdev
    flexdev avatar
    4 posts
    Member since:
    May 2015

    Posted 20 Oct 2015 Link to this post

    So based on this: http://demos.telerik.com/kendo-ui/upload/angular , I should be able to combine these, but cannot. Am using angular (not v2) and have basically went through this verbatim with no luck. I mean, I drag or select, and it does not show any files. My code in my view is:

     

                        <div class="de

    <form>                   
        <div class="demo-section k-content" ng-controller="claimsController">
                            <div>
                                <h4>Upload files</h4>
                                <input name="files"
                                       type="file"
                                       kendo-upload
                                       k-async="{ saveUrl: 'save', removeUrl: 'remove', autoUpload: true }"
                                       k-select="onSelect"
                                       />
                            </div>
                            <div style="padding-top: 1em;">
                                <h4>Console</h4>
                                <div class="console"></div>
                            </div>
                        </div>
    </form>

  2. flexdev
    flexdev avatar
    4 posts
    Member since:
    May 2015

    Posted 20 Oct 2015 in reply to flexdev Link to this post

    Well that was quirky. To add to this, my controller code is:

        $scope.onSelect = function(e) {
                    var message = $.map(e.files, function(file) { return file.name; }).join(", ");
                    kendoConsole.log("event :: select (" + message + ")");
        };

    Mind you, this controller also exists for other pieces and so what I am showing here is what I believe to be the scope for this action.

     

    Thanks much.

  3. Kendo UI is VS 2017 Ready
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 23 Oct 2015 Link to this post

    Hi,

    Please accept my apologies for the delayed response.

    I can't spot anything wrong with the code snippet.

    You should omit the form, as that's not needed for asynchronous uploads.
    Still, this shouldn't have any adverse effects.

    Can you please check if you're getting any JavaScript errors?
    I suspect that kendoConsole is undefined in your case as its part of the demos.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top