@tjoyce Hi! I am not a php developer but after looking at your post I did some digging and found what I was missing. In my form body I was missing another parameter on the file property to pass the filename (hence my error).
For all the nodejs devs out there:
const bodyFormData = new FormData();
bodyFormData.append("file", file.content, { filename: file.filename });
bodyFormData.append("folderPath", folderPath);
bodyFormData.append(
"options",
JSON.stringify({
access: "PRIVATE",
overwrite: true,
duplicateValidationStrategy: "NONE",
duplicateValidationScope: "EXACT_FOLDER",
})
);
return _api
.post("/files/v3/files", bodyFormData, {
headers: {
Authorization: `Bearer ${token}`,
...bodyFormData.getHeaders(),
},
})
.then(({ data }) => data)
.catch(e => {
console.log(e);
throw new Error(
`Failed getting creating file ${e.response?.status} - ${e.response?.statusText} - ${e.response?.data?.message}`
);
});