susee:log

This commit is contained in:
suseendhiran17 2023-07-19 16:37:46 +05:30
parent 5cdefc41ce
commit 896ff69c40

View File

@ -219,7 +219,7 @@
<%= data[i].file[j] %> <%= data[i].file[j] %>
</li> </li>
<button type="button" id="<%= data[i].file[j]+'|'+data[i].folder %>" class="btn btn-danger delete">Delete</button> <button type="button" id="<%= data[i].file[j]+'|'+data[i].folder %>" class="btn btn-danger delete">Delete</button>
<a onclick="downloadImage('<%= data[i].img[j] %>')">Download link</a> <a onclick="downloadImage('<%= data[i].img[j] %>' , '<%= data[i].file[j] %>')">Download link</a>
</ul> </ul>
</div> </div>
<% } %> <% } %>
@ -324,12 +324,12 @@ $(".delete").click(function(){
}); });
}); });
function downloadImage(data) function downloadImage(data,fileName)
{ {
const base64Image = data; // Replace this with your actual Base64 image data const base64Image = data; // Replace this with your actual Base64 image data
const downloadLink = document.createElement('a'); const downloadLink = document.createElement('a');
downloadLink.href = base64Image; downloadLink.href = base64Image;
downloadLink.download = 'log.txt'; // Replace with the desired file name and extension downloadLink.download = fileName; // Replace with the desired file name and extension
downloadLink.click(); downloadLink.click();
} }
</script> </script>