how to get multiple file from AWS?

I am trying to get multiple file in AWS to Mendix.    here is my situation that I faced.    on AWS, I will save several files from my ERP system automatically.  the file will be named by timestamp automatically.  I am trying to get each file from AWS to Mendix with same file sequence in AWS by timestamp.  on this, I am trying to use S3 Connector, List action and Get action.  with List, I will make a list to files on S3, and trying to get all files using get action.  for this it should be get file when S3 has new file, so I will trying to make loop for List and Get action. for this, the problem that I faced is what should I put a value on Key to get file?  also if you have any good idea to get file from AWS in consecutive order, please give me a advice too.    thank you.    
1 answers

Hi KooHyun,


Using the ListObjects action and pairing it with the GetObject action would indeed retrieve multiple objects. For the Key attribute, you would provide the S3 Object's name as it is displayed in your Amazon S3 Bucket or use the Key attribute from the ListedObject entity from the ListObjects action.


Be aware that the relative path towards the file you want to retrieve needs to be included in the Key attribute in your GetObjectRequest object. For more information on S3 object key names, please refer to AWS user guide.


Some ideas to order the list of S3 Objects, you can:

  1. Use the LastModified attribute of the S3Object generalization entity, if the last modified date is something you would want to order on.
  2. Alternatively, loop over the list of ListedObject objects, parse the S3 Object's name (provided the timestamp is parsable), set the parsed date to the LastModified attribute (provided you don't need it), sort the last on the attribute and you can loop over said list to invoke the GetObject microflow action from the Amazon S3 connector.


Hope this helps!