I have all the logic done, but in the router when I find a directory how can I go back and list all files in that directory?
The scenario automates the compression of images stored in a specific Google Drive folder. Here’s how it works:
- Monitor Folders: Watches a designated Google Drive folder for changes or new folders.
- Search Files: Searches for files and folders within the monitored folder, retrieving up to 1000 files.
- Process Each File:
- Make sure it’s an image by mimeType and is not in webp format already
- Retrieves the file from Google Drive.
- Compresses the image to WebP format.
- Sets a new filename with “.webp” extension.
- Updates the original file with compressed data and new filename.
- Updates the MIME type via API call.
- Folder Check: Ensures only files are processed, not folders - How do I process the files within nested folders???