How do I delete files from AWS S3 using the S3Adapter with CloudCode

I’m looking to delete files off of my S3 bucket on afterDelete('MyImageClass") in CloudCode.

I am using the S3Adapter on my ParseServer setup and can save files as expected to my S3 Bucket.

But, how do I go about accessing or deleting the files off of my S3 bucket when in CloudCode? Can anyone point me to the docs (which for the life of me I couldn’t find). or any leads so I could try it out?

I found this deleteFile function in the index.js file but how do I go about accessing this in CloudCode if it’s possible to?


file.destroy({ useMasterKey: true }) should to the magic: JavaScript Developers Guide | Parse

1 Like

ah! duh. that makes sense since I set up my server with the s3Adapter.

thanks! will try it out.