I am trying to make a Web App with Google Apps Script that actually returns an image file instead of just text. I tried it as simple as that:
function doGet() {
var file = DriveApp.getFileById('[redacted]');
return file;
}
When publishing it as a web app and executing it, it just says
The script completed but did not return anything.
I know the file exists and is accessible, since I can print its MIME type, which is a proper image/png
. So I'm missing something obvious here, but being not particularly well-versed in Google Apps Script, let alone web development of any kind, I don't know what that is I'm missing and searching for introductory material on returning an image from a Google Apps Script has not been particularly fruitful either, especially when I'm not realyl sure where to start at all.
Is it even possible to return an image file from a web app via Google Apps Script?