Is there any tutorial or step by step guide to deploy a project to a domain with picture download functionality?
I have tried to deploy to the web, but I tried from DeepAR’s Demo Project, using ‘npm run build’ (the first build had problems, not sure if it was because my computer was Windows, so I had to change the Build command in package.json ). Then upload all file in ‘dist’ folder to server.
As for downloading to the machine,
async function saveScreenshotToDownload(blob) {
try {
// Create a link element
const link = document.createElement('a');
const timestamp = Date.now(); // Generate a timestamp for the filename
const filename = `screenshot_${timestamp}.png`; // Create a filename
// Create a URL for the Blob and set it as the href of the link
link.href = URL.createObjectURL(blob);
link.download = filename; // Set the download attribute with the filename
// Programmatically click the link to trigger the download
document.body.appendChild(link); // Append the link to the body
link.click(); // Trigger the download
document.body.removeChild(link); // Remove the link after downloading
console.log('Image saved to Download:', filename);
} catch (error) {
console.error('Error taking snapshot:', error);
}
}