readFileAsync file path resolution in Bot environm...
# support
d
Hey team, I'm running into an issue when trying to read an image file for a PDF generation in the context of a Bot. I have been using this solution to target a relative path: const logoImageBytes =
fs.readFileSync(path.join(__dirname, 'assets', 'images', 'imagine-logo.png'));
which resolves to
/var/task/assets/images/imagine-logo.png
when run in the context of a Bot, resulting in a "no such file" error. I'm curious if the team has any solution or advice for reading files properly in the bot environment?
r
Would it be possible to base54 encode the logo? e.g. const MY_LOGO = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...'
by base54 I mean base64 🙂
182 Views