I have an requirement that consists to upload a document to a specific folder structure on sensenet.
To create the folder structure I'm using the Tools.EnsurePathAsync. After this I upload the file to the folder structure that I just created. The folder is creating great. But the file only in a few cases is uploaded.
Task.Run(() => Tools.EnsurePathAsync(pathDocType)).Wait();
Task.Run(() =>{
var stream = new MemoryStream(byteContent);
Content.UploadAsync(pathDocType, "test.doc", stream).WaitAndUnwrapException();
stream.Dispose();
}).Wait();