How to update file in a Document library in SP2010
-
2 พฤษภาคม 2555 9:04
Hi
i want to update file in Document Library with another file ,
is it possible because listitem.file is readonly ,please tell me the possible ways to do it
tnx ajay
ตอบทั้งหมด
-
2 พฤษภาคม 2555 9:09
Hello.
You could use listItem.File.SaveBinary method ( http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.savebinary.aspx ).
And if the permissions are issue, you can always run it under elevated privileges context (if you are allowed by business logic).
Please don't forget to mark the post as Helpful if you find my comment useful and as Answer if it solved your problem.
- ทำเครื่องหมายเป็นคำตอบโดย Shimin Huang 11 พฤษภาคม 2555 8:11
-
2 พฤษภาคม 2555 9:56
Hi Ajay,
If you can use this code on this post, once the file names are the same in the library SharePoint will overwrite the file or create a new version depending on your library settings.
http://www.sharepoint-insight.com/2009/01/10/programmatically-upload-a-file-to-document-library/
Regards,
Luke
- ทำเครื่องหมายเป็นคำตอบโดย Shimin Huang 11 พฤษภาคม 2555 8:11