I am trying to upload an aspx page to a document library that I use the keep all my pages in.
The immediate thing that sprung to mind was some kind of permissions problem, but this should not be the case since I am the site collection administrator. Just in case this was hiding the issue I gave somebody else the permission "Add and Customize Pages". They got the same error.
The issue happens through the SharePoint UI. With this in mind I wrote a simple stand-alone application in an attempt to upload the file - the important bit of the code follows -
SPList list = web.GetList(listUrl);
FileInfo fileInfo = new FileInfo(filePath);
string destFileUrl = list.RootFolder.ServerRelativeUrl + "/" + fileInfo.Name;
FileStream fileStream = File.Open(filePath, FileMode.Open);
web.AllowUnsafeUpdates = true;
web.Files.Add(destFileUrl, fileStream, true);
web.AllowUnsafeUpdates = false;
fileStream.Close();
Unfortunately this also encounters the same error. The error message is as follows -
The URL 'Pages/Credentials.aspx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
"Credentials.aspx" is the file I am trying to upload and "Pages" is the library. I have uploaded non-aspx files to this library with no problem and the same error occurs if I try to upload an aspx file elsewhere.
Please could somebody shine some light on this?
After switching on verbose logging, immediately the error message displayed provided (seemingly) more detail. I have searched around and it seems that people get similar errors doing a variety of different things - but I could not see a pattern or answer to resolve my situation. The following is the new detail -
0x81020030owssvr.dll: (unresolved symbol, module offset=00000000000B7EC4) at 0x000007FEE99D7EC4 mscorwks.dll: (unresolved symbol, module offset=00000000002BE497) at 0x000007FEF414E497 Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000E7C3A) at 0x000007FEEB6D7C3A Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AA1C13) at 0x000007FEEE811C13 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001C4DC06) at 0x000007FEEE9BDC06 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001C4C840) at 0x000007FEEE9BC840 The URL 'BistechSystem/Credentials.aspx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: 0x81020030owssvr.dll: (unresolved symbol, module offset=00000000000B7EC4) at 0x000007FEE99D7EC4 mscorwks.dll: (unresolved symbol, module offset=00000000002BE497) at 0x000007FEF414E497 Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000E7C3A) at 0x000007FEEB6D7C3A Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AA1C13) at 0x000007FEEE811C13 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001C4DC06) at 0x000007FEEE9BDC06 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001C4C840) at 0x000007FEEE9BC840 The URL 'BistechSystem/Credentials.aspx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.