how to upload and download excel file on client side local folder in angularjs?

how to upload and download excel file on client side local folder in angularjs?
Tagged:

Answers

  • @sandeshsonikar2018
    This portal is aimed at software developers utilizing Thomson Reuters APIs. Is your question related to any Thomson Reuters APIs? If yes, could you specify which Thomson Reuters API or which Thomson Reuters product you're using?

  • I had the same problem and spend many hours find different solutions for AngularJS code,

    You can do something like this using Blob.


    <a download="content.txt" ng-href="{
    { url }}">download</a>


    in your controller:


    var content = 'file content for example';

    var blob = new Blob([ content ], { type : 'text/plain' });

    $scope.url = (window.URL || window.webkitURL).createObjectURL( blob );


    in order to enable the URL:


    app = angular.module(...);

    app.config(['$compileProvider',

    function ($compileProvider) {

    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|blob):/);

    }]);