Forbidden error on SP Online Subsites


Hi There,

I have tried your tool today (and I must say it is very clean and nice to use) but found that when connecting to a subsite on SharePoint Online it returns a forbidden error.

When connecting to: https://company.sharepoint.com it authenticates correctly and I am able to upload to a library.

However, when connecting to https://company.sharepoint.com/sites/test I get a forbidden error.

I am using the same user with the same permissions (Full Control and Contribute) on both sites. This occurs in subsites both on SP Online 2010 and 2013.

Many thanks,

Closed May 10, 2016 at 12:48 PM by MadAboutImport


MadAboutImport wrote Oct 3, 2013 at 2:25 PM


Thanks. I have seen a similar issue before. From recollection I think that this might be down to the way that the destination selection tree builds the urls.

Try it both ways. Entering
https://company.sharepoint.com it



As the initial url, load the site and select the destination library and import.

Please do confirm if this helps or not.

scollinguk wrote Oct 3, 2013 at 2:44 PM

Hi There,

Entering https://company.sharepoint.com will load that site and show the libraries in the site but doesn't not show the libraries in the subsites.

If I enter https://company.sharepoint.com/sites/test I get a forbidden error.

That means that I can only upload to the one main site and am not able to upload to any subsites.

As SharePoint Online builds all subsites using this it would mean that the tool wouldn't be suitable for SharePoint Online.

I would expect that its due to the way the credentials are being submitted in accordance with the way SharePoint Online expects them.

Many thanks,


MadAboutImport wrote Oct 4, 2013 at 10:54 AM


Thanks for taking the time to write back.

It has dawned on me that these are not sub-sites but actually additional site collections. I am assuming you can connect to these site collections with the exact same credentials and see the libraries and sites within.

When you get the forbidden error DIFS should give you a bit more detail such as the method that the error, this would be useful.

Not sure why it is not working but it might be a problem with the loading the tree view rather than importing so you could try and enter manually the different parts of the URL that the tree view populates for you and then try an import.

In any event this will need to be tested in the next DIFS release.

scollinguk wrote Oct 10, 2013 at 8:28 AM

Hi There,

I have been reviewing the error and from other research and looking at the source code the error seems to come from a useragent not being passed with authentication to SharePoint Online.

Rather than explain it myself a great page showing the problem and how to fix it is here: http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx

Scroll to the section called : How to use Client Object Model with Office 365 from a remote client.

It shows that a gentle (IE no real help) 403 is thrown if a request is sent to an E series account without the UserAgent being set but works fine with P series accounts. My assumption is that as the root site has the same equivilent address as the P series this would be the problem.

With P series you can only have one site collection, where as with E series you can have as many as resource allows, hense the developers experience, I presume he didnt try to access a root site on E series without the UserAgent being set.

Unfortunately I dont code so cant help you with adding the UserAgent line but the website seems very explainatory so hopefully could be done for your next release. Do you have a planned timeframe for the next release?

Many thanks,


tadakan wrote Jan 7, 2014 at 3:30 AM

Just wanted to chime in that I'm also having this problem with a "team" site in sharepoint online. I can upload to the main site, but get 403 forbidden for the sub-sites that I've created. Let me know if I can provide any information to help you with this.

Willempje wrote Jul 15, 2014 at 11:11 AM

I m having the same problem. I can upload to the main site but i get error 403 forbidden for the sub-sites.
Can anybody help me

zimbie_z wrote Sep 1, 2014 at 7:11 AM

Uploading to OFFICE365 E3 account was having the same problem with subsite uploads but here is what worked for me. This is not perfect and doesn't seem like it is working but it is.
Load/browse to and select the correct subsite that you want to upload to in the Destination Library Box.
After you have selected what you want click on the Destination Web URL (Relative) box and delete out the full path changing it back to / This is the only modification that I made.
The import will throw an error and act like it is not working when in fact it is working. The exact error that I get is:
ImportRow:C:\Folder\filename.pdf:ExceptionThe URL 'subsite/folder subfolder/filename.pdf' 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.

MadAboutImport wrote May 10, 2016 at 12:48 PM

Caused by a problem in MSOnlineClaimsHelper - Fixed in version 2.0

wrote May 10, 2016 at 12:48 PM