I have tested Firebase functions for storage successfully. However, I havn\'t seen anywhere a hint how to only invoke the function when a file is added into a folder inside
You may check inside the function. Get the "filePath" or "fileDir" on your function and check if it is the folder you want.
const path = require('path');
const filePath = event.data.name;
const fileDir = path.dirname(filePath);
//if you want to check the posts folder only then:
if (fileDir != 'posts') {
console.log('This is not in post folder');
return null;
}