MVC .NET - file manager does not work
I have a project and app in box.
I can connect to my folders and see what is in a folder, I can create a folder.
But when I trying to do something with file - it does not work.
I tried to upload, delete and download, and every time it throw me away from my WebAPI controller.
In the last line happing something and my controller stop working. What can it be?
BoxConfig config = new BoxConfig(_clientKey, _clientSecret, new Uri("http://localhost/")); BoxClient client = new BoxClient(config); OAuthSession session = new OAuthSession("oMfD1uhmdfHSnOvrgej2VZcv34FutlRF", "NOT_NEEDED", 3600, "bearer"); _client = new BoxClient(config, session);
BoxFile newFile; using (FileStream stream = new FileStream(@"C:\app\insurance_documents.pdf", FileMode.Open)) { BoxFileRequest req = new BoxFileRequest() { Name = filename, Parent = new BoxRequestEntity() { Id = "0" } }; newFile = await client.FilesManager.UploadAsync(req, stream); }
Please sign in to leave a comment.
Comments
1 comment