Hi All,
I've recently been put on a project where I need to use the REST services (ListData.svc) to retrieve and add documents to the document library. It all has been smooth sailing until I hit the point where I want to save a document in a path that doesn't exist. I get an error if I try to save a file where the folder structure doesn't exist. I then went about it a different way trying to create the folder structure first. This also didn't work and I get an error message saying that the entity type is marked with the MediaEntry attribute but no save stream was set for the entity. Not too sure what set for the save stream if I'm just adding a folder.
So my question is can a file be added to a folder structure that doesn't exist where it automatically creates the folders. If not can the service create folders?
Some sample code I've been using:
var folder = new SampleDocumentLibraryItem();
folder.Name = "Sample";
folder.Title = "Sample";
folder.ContentType = "Folder";
folder.Path = "/sample/folder1/folder2";
spContext.AddToSampleDocumentLibrary(folder);
spContext.SaveChanges();
Thanks in advance,
Damo