Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to retrive file size of a object fetched from lists3

avatar
New Contributor

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

Sheph_1-1662459743839.png

I can see the size of the file i.e. 0 after fetchs3object 
Sheph_0-1662459376912.png

but s3.length is not 0 for 0.00bytes file:

Sheph_2-1662459956988.png

I wanted to use file size in routeanattribute processor to reject the files of 0 bytes.

Sheph_3-1662460203149.png

 

 

 

2 REPLIES 2

avatar

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

 

avatar
New Contributor

Hi,

 Thanks for the reply..

"fileSize" returns size of the flowfile i need size of the file/object listed from lists3.