The code is created with UiPath Studio (RPA tool). The request to get the content bytes looks like this:
The result of this GET is replace in the "getContentBytesResponse" variable as a string value. This is then used in the PUT method as such:
The reponse code from this call is 201 which indicates that the file was successfully created. And from the folder I see the file created, but not as an image. This picture is too large to be uploaded here. The limit is 2 MB and the file 2.4 MB.
I need to understand what is the proper approach to upload content bytes to be created as an image. Or does this upload method support text files solely?
EDITED:
Here is the response from the PUT method
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#drives('{id}')/items/$entity",
"@microsoft.graph.downloadUrl": "
"createdDateTime": "2020-06-04T06:50:31Z",
"eTag": "\"{AC1ABBB1-CE9A-4A02-93BE-6B27395A8FB7},1\"",
"id": "01PJW2BXNRXMNKZGWOAJFJHPTLE44VVD5X",
"lastModifiedDateTime": "2020-06-04T06:50:31Z",
"name": "picture_04-06-2020-08-06-30-50.png",
"webUrl": "https://{tenant}.sharepoint.com/sites/{sitepath}/picture_04-06-2020-08-06-30-50.png",
"cTag": "\"c:{AC1ABBB1-CE9A-4A02-93BE-6B27395A8FB7},1\"",
"size": 942463,
"createdBy": {
"application": {
"id": "{id}",
"displayName": "Dank Bot"
},
"user": {
"email": "dankbot-cb7313ce1c@{tenant}.onmicrosoft.com",
"id": "{id}",
"displayName": "Dank Bot"
}
},
"lastModifiedBy": {
"application": {
"id": "{id]",
"displayName": "Dank Bot"
},
"user": {
"email": "dankbot-cb7313ce1c@{tenant}.onmicrosoft.com",
"id": "{id}",
"displayName": "Dank Bot"
}
},
"parentReference": {
"driveId": "{id}",
"driveType": "documentLibrary",
"id": "{id}",
"path": "/drives/{drivepath}"
},
"file": {
"mimeType": "image/png",
"hashes": {
"quickXorHash": "zeZrJjSTjzjHtAn3QgXa5vgaxxA="
}
},
"fileSystemInfo": {
"createdDateTime": "2020-06-04T06:50:31Z",
"lastModifiedDateTime": "2020-06-04T06:50:31Z"
},
"image": {}
}
What is the correct way to upload image files?