Requirement:- There is a requirement to capture the file size of files that are picked from file source.
Solution:- In this below code, change the filename location to the location where the file is placed:-
String fileName = "C:/Users/Desktop/test.txt";
File f = new File(fileName);
long fileSize = f.length();
The file size will be displayed in the variable "FileSize". Also, this value will be shown in context info too.