Velocity Reviews

Velocity Reviews (
-   ASP .Net Web Controls (
-   -   Document movement in SharePoint 2003 (

Todd Jasper via .NET 247 05-04-2004 06:29 PM

Document movement in SharePoint 2003
I am running into problems in SharePoint Portal 2003 when my webpart goes to move documents from a document library on onesub-site to a document library on a different sub-site. Bothsub-sites are on the same level, which is one level down off themain portal site. Also, my web part has full trust privelegesto run. The security exception that I receive says:

The security validation for this page is invalid. Click Back inyour Web browser, refresh the page, and try your operationagain. ---> System.Runtime.InteropServices.COMException(0x8102 006D):

Here is my code:

Dim File As SPFile = m_Web.GetFile("/sites/FirstSite/DocumentLibrary/Folder/ExcelSpreadsheet.xls")
Dim Site As New SPSite("https://portal")
Dim Web As SPWeb = Site.OpenWeb("/sites/SecondSite")
Dim FilesCollection As SPFileCollection
FilesCollection = Web.GetFolder("/sites/SecondSite/DocumentLibrary/Folder").Files

FilesCollection.Add(File.Url, File.OpenBinary)

Any thoughts or ideas would be much appreciated, thanks.

From: Todd Jasper

Posted by a user from .NET 247 (


LarsDahl 08-05-2005 08:04 AM

Re: Document movement in SharePoint 2003

Maybe you have to set


FilesCollection.Web.AllowUnsafeUpdates = true


Just before the Add ...

Posted via
View this thread:

All times are GMT. The time now is 04:29 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.