The code example in the graph API reference for upload is misaligned to sdk 5.77.x
Hi I am working on development of the item upload using graph java sdk in Android. However, I am confused because the method PUT seems to be different from the one provided in sdk 5.77.x. The sdk api reference of 5.77.X
The code example in the microsoft graph documentation for uploading a item smaller than 240MB is attached below. It obviously the input parameters are different. The PUT method in sdk referencer requires a DriveItem but the one in the code example requires a byte array. Does anyone encounter this kind of problem? (page link: https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=java#example-updating-an-existing-file)
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
byte[] stream = Base64.getDecoder().decode("The contents of the file goes here.");
graphClient.me().drive().items("{item-id}")
.buildRequest()
.put(stream);
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more