Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Document movement in SharePoint 2003 (http://www.velocityreviews.com/forums/t773184-document-movement-in-sharepoint-2003-a.html)

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

' SECURITY EXCEPTION OCCURS HERE ON THE ADD
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 (http://www.dotnet247.com/)

<Id>xWjAbqN9K024dLGvo7ELyw==</Id>

LarsDahl 08-05-2005 08:04 AM

Re: Document movement in SharePoint 2003
 

Maybe you have to set

Code:
--------------------

FilesCollection.Web.AllowUnsafeUpdates = true

--------------------

Just before the Add ...



--
LarsDahl
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message638953.html



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.