San
San

Reputation: 1104

Update SharePoint document library file with current meta data

I'm going to make a document library with SharePoint 2010. I'm handling files that would be updated frequently and many meta data fields such as update frequency, filtering flag, monitoring flag, etc.

If SharePoint stores the files in the database, I think, it's possible to update the file content field alone without touching other fields containing meta data. But apparently it's not easy at the first glance.

Any simple way to update document content in the MOSS environment? I guess that check-out the file and update or edit then check-in is a possible solution but requires too much works for the end users.

Upvotes: 0

Views: 1220

Answers (1)

djeeg
djeeg

Reputation: 6765

You could disable check-in/check-out on the document library

Or you could do something like this in a web part

SPFile file = web.GetFile(url);
file.UndoCheckOut();
string rawdata = Path.Combine(rootdirectory, url);
byte[] data = File.ReadAllBytes(rawdata);
file.CheckOut();
file.SaveBinary(data);
file.Update();
file.CheckIn("some thing");
file.Approve("some thing");

Upvotes: 1

Related Questions