HTTP POST Upload of files using multipart/related does not upload binary

What are you trying to achieve?

Hi everyone,

I’m trying to upload na image file (jpg) in Google Drive using https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart.

Steps taken so far

The file is indeed created in the right place and with the right name (metadata), but the binary is not upload correcty. The created file is only 10b size (should be 100Kb) and is not recognized as a valid file.

Here is the Request Content:

–boundary123
Content-Type: application/json; charset=UTF-8

{
“name”: “{{42.name}}.jpg”,
“mimeType”: “image/jpeg”,
“parents”: [“1xslowTIxQ38ZMKF-Y2NF5A0VnXYozQo7”]
}

–boundary123
Content-Type: image/jpeg

{{22.data}}

–boundary123–

Credentials have been provided and working fine.
Also, the binay data is OK, since it it worked just fine with uploadType=media. However, this function uploads in Drive’s root and I coud not manage to move it to another folder using PATCH. But this is another story.
I tried also using the Google Drive APIs, but as I don’t have Google Workspace, granting access to Make is not allowed for individuals, but companies.

Any insights about what is going on?