Uploading Documents to SPS2003
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Uploading Documents to SPS2003

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
mzam
Guest





Posted: Tue Jan 04, 2005 6:49 pm    Post subject: Uploading Documents to SPS2003 Reply with quote

Hi All,

I am programmatically uploading documents to a Document Library in SPS2003.
The problem I have is that right after adding the document I start updating
the documents metadata and this causes a new version every time a metadata
is updated. I would like to avoid this, Is there a way to pass all the
metadata when the document is being added? Here is my code:

SPSite workingSite = new SPSite(myUrl);
SPWeb workingWeb = workingSite.OpenWeb();
SPFile newFile = workingWeb.Files.Add(myUrl, fileContents);
SPListItem listItem = workingFile.Item;
listItem["MyProperty"] = propertyValue["SomeValue"];
listItem.Update();


Thanks
Back to top
Martin Harwar (Content Ma
Guest





Posted: Thu Jan 06, 2005 10:39 pm    Post subject: RE: Uploading Documents to SPS2003 Reply with quote

Hi

I don't think you can pass the metadata at the same time, unfortunately.

"mzam" wrote:

Quote:
Hi All,

I am programmatically uploading documents to a Document Library in SPS2003.
The problem I have is that right after adding the document I start updating
the documents metadata and this causes a new version every time a metadata
is updated. I would like to avoid this, Is there a way to pass all the
metadata when the document is being added? Here is my code:

SPSite workingSite = new SPSite(myUrl);
SPWeb workingWeb = workingSite.OpenWeb();
SPFile newFile = workingWeb.Files.Add(myUrl, fileContents);
SPListItem listItem = workingFile.Item;
listItem["MyProperty"] = propertyValue["SomeValue"];
listItem.Update();


Thanks


Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB