Guest User

Untitled

a guest
Jun 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <a id="download" ng-click="downloadfile()">Download FileName</a>
  2.  
  3. $scope.downloadfile=function(){
  4. var download = document.getElementById("download");
  5. $scope.downloadData = 锟斤拷锟斤拷JFIF,,锟斤拷xPhotoshop 3.08BIMgP53616c7465645f5fdfdda5a4f94df34e8d1d8e056e7e5dcc820ce57f793e13bfa39119fdc1b0c079锟斤拷C锟斤拷�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟;
  6.  
  7. download.onclick = function() {
  8.  
  9. downloadFile("text.jpg", $scope.downloadData);
  10. }
  11.  
  12. function downloadFile(filename, text) {
  13. var pom = document.createElement('a');
  14. pom.setAttribute('href', 'data:image/jpeg;charset-utf-8,' + encodeURIComponent(text));
  15. pom.setAttribute('download', filename);
  16. pom.click();
  17. }
  18. }
Add Comment
Please, Sign In to add comment