aarebrot.net Frode's blog on Sharepoint and other stuff

How to set the content type of a new file in a document library, when uploading said file through code (aka longest and most convoluted blog title to date)

Posted on March 29, 2011
VN:F [1.9.22_1171]
Rating: 4.6/5 (9 votes cast)

I'm on a project that's very close to being implemented in production. For the final go-live we will be uploading a bunch of files (about 700) into a document library. There are two content types in our document library, SPI Documents and SPI Drawings. Uploading the files directly into the document library will pick the default content type. How do we change it to use the second content type, instead of the default, for some of the files?

Creating custom list event receivers in SharePoint 2007

Posted on August 11, 2010
VN:F [1.9.22_1171]
Rating: 5.0/5 (3 votes cast)

I'm working on a project these days where the requirements are to store a bunch of files in a document library, and then sync "published" files to another document library. We're probably going to end up using workflows to accomplish this because we only want approved documents to be synced. Right now however we're just in the elaboration stage of the project, so I was looking into whipping up a quick and easy way to sync files between document libraries. I chose the most obvious way, which was using list event receivers.