Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a id="download" ng-click="downloadfile()">Download FileName</a>
- $scope.downloadfile=function(){
- var download = document.getElementById("download");
- $scope.downloadData = 锟斤拷锟斤拷JFIF,,锟斤拷xPhotoshop 3.08BIMgP53616c7465645f5fdfdda5a4f94df34e8d1d8e056e7e5dcc820ce57f793e13bfa39119fdc1b0c079锟斤拷C锟斤拷�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟�锟;
- download.onclick = function() {
- downloadFile("text.jpg", $scope.downloadData);
- }
- function downloadFile(filename, text) {
- var pom = document.createElement('a');
- pom.setAttribute('href', 'data:image/jpeg;charset-utf-8,' + encodeURIComponent(text));
- pom.setAttribute('download', filename);
- pom.click();
- }
- }
Add Comment
Please, Sign In to add comment