Tag Info

Hot answers tagged

1

SPListItemCollection is a collection of SPListItem. Get File object from SPListItem. Example: foreach (SPListItem item in items) { SPFile file = item.File; }


1

I found an answer here. Users with contributor permissions are prevented from uploading files with the following extensions: ASPX; MASTER; XAP; SWF; JAR; ASMX; ASCX; XSN; XSF; So my problem is in "aspx" extension of file I'm trying to create. This could be fixed by removing 'aspx' from WebApplication.WebFileExtensions ...


1

You might not have permissiosns to see that file. You should also add a check for file existence like : SPFile u = l.RootFolder.Files.Add(l.RootFolder.Url + "/" + f.Name, f.OpenBinary(), true); if (l.Exists) { l.RootFolder.Update(); l.Update(); w.Update(); }



Only top voted, non community-wiki answers of a minimum length are eligible