- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to retrive file size of a object fetched from lists3
- Labels:
-
Apache NiFi
Created ‎09-06-2022 03:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to reject 0bytes files received in s3 bucket but i am not able to fetch the size.
How i was trying to achieve it:
i read in doc that s3.length attribute is the size of the object in lists3
I can see the size of the file i.e. 0 after fetchs3object
but s3.length is not 0 for 0.00bytes file:
I wanted to use file size in routeanattribute processor to reject the files of 0 bytes.
Created ‎09-06-2022 06:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you can use the flowfile size attribute "fileSize" to check for the size. for example if you want to process flowfile from S3 that has contents you can create new property in the RouteOnAttribute processor with the following EL: ${fileSize:gt(0)}
If you find this helpful, please accept solution.
Thanks
Created ‎09-06-2022 07:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for the reply..
"fileSize" returns size of the flowfile i need size of the file/object listed from lists3.
