0

I am fetching file properties from a document library using below query(I am using c#,csom)

camlQuery.ViewXml = @"<View Scope='RecursiveAll'>
                         <Query>
                               <ViewFields>
                                  <FieldRef Name='File_x0020_Type' />
                                  <FieldRef Name='File_x0020_Size' />
                              </ViewFields>
                            <Where>
                                <Eq>
                                   <FieldRef Name='FSObjType' />
                                   <Value Type='int'>0</Value>
                                 </Eq>
                             </Where>
                         </Query>
                       </View>";

This works perfectly fine.

The output of file size is :

879394
595284
561276
620888
775702
780831
777835
845941
620888
780831
845941
561276

I am unable to understand this whether it is in KB or what is the unit and how to interpret this.

Could someone help me here please?

Thanks!!

0

ShowField in onet.xml says SizeInKB for this field.

Source: https://books.google.hr/books?id=2r_aYaOx_PAC&pg=PT117&lpg=PT117&dq=File_x0020_Size&source=bl&ots=mDOzdQM77o&sig=rolwgtkG9PtpuIu4z9fYGIoOB9c&hl=en&sa=X&ved=0ahUKEwiu5e_b3sfVAhXE0RQKHRMoDy0Q6AEIVzAJ#v=onepage&q=File_x0020_Size&f=false

  • I added SizeInKB to my CAML qry and I got this error: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. – user2598808 Aug 8 '17 at 13:47
  • The results you got are in KB. – Slaven Semper Aug 8 '17 at 14:07
  • Ok, so I should consider this as KB. Any references in msdn or any such informative links which i can go through? Thank you @Slaven – user2598808 Aug 8 '17 at 14:11
  • For SP 2013 C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\GLOBAL\XML\ONET.XML file contains field definitions. One of these definitions is <Field ID="{8fca95c0-9b7d-456f-8dae-b41ee2728b85}" Name="File_x0020_Size" Hidden="TRUE" ReadOnly="TRUE" Type="Lookup" DisplayName="$Resources:core,File_Size;" List="Docs" FieldRef="ID" ShowField="SizeInKB" Format="TRUE" JoinColName="DoclibRowId" JoinRowOrdinal="0" JoinType="INNER" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="File_x0020_Size"> </Field> – Slaven Semper Aug 8 '17 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.