Elastic Beanstalk: writing files to a folder in my node.js project folder

rawcoder
rawcoder used Ask the Experts™
on
I created an application on my local machine(mac os x) that generates a report and saves it to a folder in my web project folder. When I deploy the app., this folder should get published as well. Granted, no one should have access to this folder but the app. When I run the code to generate the report works fine on my local machine, but it seems to hang on elastic beanstalk. What do I need to do to make this work on the elastic beanstalk environment?

In a nutshell, I am using phantomjs to convert a dynamic webpage into a pdf file that gets emailed to the appropriate parties involved. Here is the code that generates the file:

page.viewportSize = { width: 2000, height: 800 };
//page.paperSize = { format: 'Letter', orientation: 'landscape', margin: '1cm' };
page.paperSize = { width: '1280px', height: '800px', margin: '0px' };
page.settings.localToRemoteUrlAccessEnabled = true;
page.settings.loadImages = true;
page.settings.javascriptEnabled = true;


page.open("http://example.com/report/" + args[1], function start(status) {
  if (status === 'fail'){
      phantom.exit(1);
      return;
  }

//page.render('/dev/stdout', { format: 'pdf' });
  page.render(fs.workingDirectory + '/tmp/' + args[3], { format: 'pdf' });
  phantom.exit();
  return;
});

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial