DEV Community

Discussion on: Practical Puppeteer: How to upload a file programatically

Collapse
 
olizh profile image
Oliver Zhang • Edited

Hi Sony, first of all, thanks for a very useful post. This works perfect on my Mac. But when I deploy the code on Heroku, the file doesn't really upload. It looks like Pupeteer on Heroku couldn't find the file in the following line, thus the submit resulting in no file upload:

inputUploadHandle.uploadFile(fileToUpload);

The file exists in that path on Heroku's server because I'm able to send that file as an email attachment using Node Mailer. I'v been scratching my head for two days in a row. I wonder if you happen to have tried this on a Heroku app.

Collapse
 
sonyarianto profile image
Sony AK

Hi Oliver, sorry for super late reply, maybe file path is wrong? or try by using full path to the file.