I can't resolve my problem - create link to download attachment.
A file I receive from SOAP service in xml and consequently I must create a link to download file.
What I have now:
In controller:
   //creating comments
    for (var index in $scope.comments){
                        var com = $scope.comments[index]
                        if (com.z2AF_Work_Log01_
                          var a         = document.createElement('a');
                          a.target      = '_blank';
                          a.download    = com.z2AF_Work_Log01_
                          a.innerText   = com.z2AF_Work_Log01_
                          var blob = new Blob([atob(com.z2AF_Work_Log01_
                            { type : 'zip' });
                          //com.href  = (window.URL || window.webkitURL).
                          a.href = (window.URL ||window.webkitURL).createObject
                          com.attachment_link = a.outerHTML;
                        }
                      }
Links created, but if I have not plain text (csv) a file after download is broken. When I download csv - all fine.
In template:
  .attach ng-bind-html="comment.
Thanks.
 
댓글 없음:
댓글 쓰기