I’m trying to upload a file to a SharePoint folder. The activity is working and the file is successfully being uploaded but as soon as the activity finishes I get the error in the title.
Has anyone encountered this before? I’ve never had an activity work correctly and then throw an error. I’ve also googled the error but I’ve not found any explanations or solutions that are relevant to my case.
Here’s my code:
Hey Max, are you sure you are trying to upload the txt file in a library? It seems you are using a list and Sharepoint by design does not allow you to upload files to lists. So try to use a library instead or add this item as an attachment to an existing list item.
One reason for that error message could also be the specification of the “Sharepoint Application Scope” URL - its important to set it to a specific site, e.g.:
Afterwards use the item URL of the “upload” activity to specify the target directory (and name) - the path has to be relative to the “Application Scope” URL, e.g.:
/Project/Documents/10_ProjMgmt/Temp/test2.csv
IMPORTANT: If you would use these URLs instead - you are getting the error mentioned above!
Old topic–but in case anyone else runs into this, I was getting the “does not belong to a list” error because I had "" (backslash) characters in my Item URL instead of “/” (forward slash). File uploaded okay, but threw the error.