Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am uploading documents to Document Library using copy web service. I need to update read only fields like created, created by, modified, modified by, version,.. I changed the read only property of those fields to false and updated the values, but i can't update for created by and modified by fields. How to do this?

Also i used DWS web service to create new folder in Document Library. Here also i need to update those values. How to achieve this. Is there any similar property like Field Information in DWS web service??

share|improve this question
    
could you add your code so we can see what might be the problem? –  lem.mallari May 13 '13 at 5:43
    
FieldInformation i1 = new FieldInformation { DisplayName = "Created By", InternalName = "Author", Type = FieldType.User, Value = "userid;#username" }; I am getting no error and content also not updated. Created By field is updated with credential that i used for this web service and not with new user i mentioned here. –  suren May 13 '13 at 5:57
    
It might be easier to edit your question to include the code (formatted) rather than add using a comment. –  SPDoctor Jun 24 '13 at 14:51

1 Answer 1

Following code snippet could help you.

// add the file  
SPFile file = docLib.RootFolder.Files.Add(newFileName, inputStream);  
// get the list item for that file  
SPItem item = file.Item;  
//Set the Created Date
item["Created"] = "2009-02-26 15:00:00";
item.Update();
share|improve this answer
    
I am using only web service. I can't use any SharePoint objects here. –  suren May 13 '13 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.