Re: SPFileCollection , files.add method PROBLEMS
- From: "S.S. Ahmed" <ss_ahmed1@xxxxxxxxxxx>
- Date: Tue, 5 Sep 2006 11:13:23 +0500
Try to impersonate as an admin. Even if you are using admin login,
impersonate as an admin explicitly. See the following post:
http://www.sharepointblogs.com/ssa/archive/2006/08/30/11624.aspx
Regards,
--
S.S. Ahmed
www.walisystems.com
<ilakidain@xxxxxxxxxxx> wrote in message
news:1157377361.719279.120960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Community
I have serius problem with the method "Add" from "SPFileCollection"
The matter:
If i use the parameters :
SPFile fichero = objCarpeta.Files.Add(strCarpetaLista +
strUrlRelativa,arrFichero,true);
it works perfectly but with the paremeters:
SPFile fichero = objCarpeta.Files.Add(strCarpetaLista +
strUrlRelativa,arrFichero,autor ,editor
,datFechaCreacion,datFechaModificacion);
NOT WORK ................ Show a message error:
" at Microsoft.SharePoint.h.a(UnauthorizedAccessException A_0)
at Microsoft.SharePoint.Library.a.a(String A_0, String A_1, Object
A_2, PutFileOpt A_3, String A_4, String A_5, Int32 A_6, Int32 A_7,
Object A_8, Object A_9)
at Microsoft.SharePoint.SPFileCollection.a(String A_0, Byte[] A_1,
PutFileOpt A_2, String A_3, String A_4, Int32 A_5, Int32 A_6, DateTime
A_7, DateTime A_8)
at Microsoft.SharePoint.SPFileCollection.Add(String strUrl, Byte[]
file, SPUser createdBy, SPUser modifiedBy, DateTime timeCreated,
DateTime timeLastModified)
at MigracionWinApp.Migracion.copiarelementosdoclibarbol(SPWeb objWeb,
Guid guidlista, String strTablaLista, Int32 idLista, Int32 tipolista)"
Some notes:
- it's a windows form application.
- The files adding in a area, the users "autor" y "editor" have the
permissos in area.
- the library (in the area) it's created previusly.
- all the parameters are Ok, the objects "autor" and "editor"user I
get with one function.
.
.
.
SPUser autor = ObtenerUsuario(objWeb,
CorregirDominioUsuario(strAutor));
SPUser editor =
ObtenerUsuario(objWeb,CorregirDominioUsuario(strEditor));
.
.
.
public SPUser ObtenerUsuario(SPWeb objWeb, string strUsuario)
{
PortalSite ps = tm.PortalSites[ new
Uri(ClassGeneral.strURL_WINDOWS_SHAREPOINT_SERVICES)];
Microsoft.SharePoint.Portal.PortalContext ctx =
Microsoft.SharePoint.Portal.PortalApplication.GetContext(ps);
Area homearea = AreaManager.GetArea (ctx,guiSubWebID); // guiSubWebID
se obtiene al pulsar sobre la libreria/area
SPUser usuariodev = homearea.Web.AllUsers[strUsuario];
}
Why fail ????
SPFile fichero = objCarpeta.Files.Add(strCarpetaLista +
strUrlRelativa,arrFichero,autor,editor,datFechaCreacion,datFechaModificacion);
Any help appreciated :-)
And thanks in advance.
.
- Follow-Ups:
- Re: SPFileCollection , files.add method PROBLEMS
- From: ilakidain
- Re: SPFileCollection , files.add method PROBLEMS
- References:
- SPFileCollection , files.add method PROBLEMS
- From: ilakidain
- SPFileCollection , files.add method PROBLEMS
- Prev by Date: Re: Remove Upload Multiple document from the document library in MOSS
- Next by Date: Number of Columns in Data View
- Previous by thread: SPFileCollection , files.add method PROBLEMS
- Next by thread: Re: SPFileCollection , files.add method PROBLEMS
- Index(es):
Relevant Pages
|