I’m attempting to use the Hubspot API to upload files dynamically from my website to our HubSpot file system. I’m using PHP / cURL to do this with code similar to the following:
I get a status code of 200 but I’m not seeing the files appear in our file manager. Is the syntax incorrect for the multipart form data? Is this not allowed? Am I doing something else incorrectly?
I was also having this same problem and spent hours to make it work. I found out that its just a simple syntax in the $params string referencing @Chris_Adams code. The root of the issue is at the last custom boundary string in the code:
It needs to have an additional -- at it’s start to make it work.
So it would need to be changed to this "----custom-boundary-123456789--";
I tried it and it worked for me. Hopefully this can also help others
I used this gist as reference and compared the codes. Thanks to this