Sharepoint 2010 How to use "File Size" column value in a formula? -
i trying use "file size" (aka "filesizedisplay") in calculated column formula.
"file size" existing column (default sp not custom). not available in "insert column" list of library. , sp displays error message states not exist if added formula manually either [file size] or [filesizedisplay].
all want inform user image big. not trying prohibit file size upload or technical that. want calculated column display message. if column value available following work:
=if([file size]>50000,"image big","image sized correctly") or
=if([filesizedisplay]>50000,"image big","image sized correctly") any 1 know why column not available?
cheers
you'll want file size first: get file size can display of message in pop or how ever you'd like
using system; using system.io; class program { static void main() { // name of file const string filename = "test.txt"; // create new fileinfo object , length. fileinfo f = new fileinfo(filename); long s1 = f.length; // change file. demo. file.appendalltext(filename, " more characters."); // create fileinfo object , length. fileinfo f2 = new fileinfo(filename); long s2 = f2.length; // print out length of file before , after. console.writeline("before , after: " + s1.tostring() + " " + s2.tostring()); // difference between 2 sizes. long change = s2 - s1; console.writeline("size increase: " + change.tostring()); } }
Comments
Post a Comment