views:

127

answers:

2

I have a website in Sharepoint 2007. I need to do a query of documents in a document library in a SPWeb/site and to know the KBs of the document.

In fact, i have to extract which is the url of the document from a linkfield and then look for the KBs?

Anyone can provide the query? or the method? Can i do this with a SPSiteDataQuery?

+2  A: 

There is a field with the internal name File_x0020_Size (SPBuiltInFieldId.File_x0020_Size = {8fca95c0-9b7d-456f-8dae-b41ee2728b85})

You can probably use that to do a query against the files size.

JMD
Finally I used FileSizeDisplay in my query. I have written another question to ask for any improvement, thank you.http://stackoverflow.com/questions/634321/could-this-query-to-get-the-size-of-a-doc-be-improved-in-sharepoint-2007
netadictos
A: 

If the above answer does not do it for you, you can use the object model to figure it out. The SPListItem has a File property which is a SPFile object. That has a Length property which is the file size/length in bytes. Obviously this approach requires iterating each SPListItem.

Kirk Liemohn
Finally I used FileSizeDisplay in my query. I have written another question to ask for any improvement, thank you. http://stackoverflow.com/questions/634321/could-this-query-to-get-the-size-of-a-doc-be-improved-in-sharepoint-2007
netadictos