I've included S3FS module in Drupal 7. I'm able to store files by using S3FS as a field of a node.

Now, I need to store a file on S3 bucket when a cron job is executed. How can I programmatically use the module?

  • I would expect the techniques and maybe helper functions to be in the s3fs module. – cilefen Feb 13 '16 at 1:32
  • Is there any sample code available to understand the usage of those helper function? I didn't find any so far. – Vish Feb 16 '16 at 19:23
  • I'm able to connect to S3 bucket via creating a mount directory by using s3fs-fuse. I was expecting to use some calls or S3FS directly in the code. – Vish Feb 17 '16 at 21:09

I used the following command to write the file. The system picks up the S3 connection (as I mentioned earlier that I'm able to store file as a field of a node):

file_put_contents('s3://Dir1/output.json', $jsonStr);

I created this module that copies images, css, js to s3 https://www.drupal.org/sandbox/mikeytown2/2678270

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.