Store files from folder
Function: Store files from folder
This function allows you to automatically transfer files from a specified folder into your application's Media Library. This is useful for centralizing your files, making them accessible within your application, and managing storage. You can also choose to remove the files from the original folder after they've been stored.
Input
- Folder: The specific folder from which you want to retrieve files. This could be a folder on an FTP server or a similar connected storage. (Required)
- Limit: An optional number to specify the maximum count of files you want to transfer from the folder. If left empty, all files in the folder will be processed.
- Delete from folder: A toggle (True/False) that determines whether the files should be removed from the original folder after they have been successfully stored in the Media Library. (Required)
Output
- Media library IDs: A list of unique identifiers (IDs) for each file that was successfully stored in the Media Library. This output is typically stored in a variable named
FILES. - The status: Indicates the outcome of the operation (e.g., "SUCCESS" or an error message). This output is typically stored in a variable named
READ_FOLDER_STATUS.
Execution Flow
Real-Life Examples
Example 1: Archiving Daily Reports
Imagine you have a system that generates daily sales reports and saves them to a specific folder on your connected storage. You want to move these reports to your application's Media Library for long-term storage and easy access, and then clear the original folder.
- Inputs:
- Folder:
/ftp/reports/daily_sales - Limit: (empty)
- Delete from folder:
True
- Folder:
- Result: All daily sales reports from the
/ftp/reports/daily_salesfolder are moved into your application's Media Library. TheMedia library IDsoutput will contain a list of IDs for these reports, and the/ftp/reports/daily_salesfolder will be empty. TheThe statusoutput will be "SUCCESS".
Example 2: Importing New Product Images for Review
You receive a batch of new product images from a supplier, placed in a temporary folder. You want to import only the first 50 images into your Media Library for review by your marketing team, but keep the originals in the temporary folder until they are fully approved.
- Inputs:
- Folder:
/ftp/product_uploads/new_images - Limit:
50 - Delete from folder:
False
- Folder:
- Result: The first 50 product images found in
/ftp/product_uploads/new_imagesare copied to your application's Media Library. TheMedia library IDsoutput will contain the IDs of these 50 images. The original images will remain in the/ftp/product_uploads/new_imagesfolder. TheThe statusoutput will be "SUCCESS".
Example 3: Processing User-Submitted Documents
Your application allows users to upload documents to a specific folder for processing. You want to take the first 10 documents from this "pending" folder, store them in the Media Library for further workflow, and then remove them from the pending folder to avoid reprocessing.
- Inputs:
- Folder:
/ftp/user_submissions/pending - Limit:
10 - Delete from folder:
True
- Folder:
- Result: The first 10 user-submitted documents from
/ftp/user_submissions/pendingare moved to your application's Media Library. TheMedia library IDsoutput will provide the IDs for these 10 documents. These 10 documents are then removed from the/ftp/user_submissions/pendingfolder. TheThe statusoutput will be "SUCCESS".