I have been looking for a way to upload a file to a Sharepoint document library with metadata included. After searching a bit on the net, I found the FPSEPublish sample that uses Frontpage Server Extensions RPC methods to do it.

The zip file you can find in this post contains a binary called FPSEPublish.exe that you can use to test. Source code is included (C#) so you can implement this in your own application.

On our Sharepoint server, I created a test document library with some fields and then used the following command (one line).

fpsepublish putdoc http://portal/restricted/help/test.xls c:\test.xls Custom;SW|Test;Custom2;SW|Hi;Owner;SW|Geert;vti_title;SW|Title;Status;SW|Final;Desc;SW|Describe me"

How you set metadata is a bit strange.

  • Syntax: fieldname;XW|value;fieldname;XW|value where X can be S for a string, I for an integer, B for a boolean.
  • For the Title property, I had to use vti_title instead of Title.

This will prove to be very useful when we start to build custom applications that need to upload documents to document libraries and set metadata at the same time.