Upload files via Form API

Hello,

I was just testing file upload via the form. It worked, the file was successfully uploaded, my contact property for the file was updated, I got CDN link to that file and it was hidden in File Manager as stated in your documentation.

However, how can I upload a file the same way using Form API?

Thanks in advance,
Nikola

Hi @nikolajovanovic,

As David outlines in this post

Form API File field Forms

Hi @andreas.tinocolobo File upload properties are text properties, and they’re designed to store the URL of a file that’s uploaded to some storage platform. The property itself cannot store an actual file, so if you’re using an upload property in a custom form, you’d need to upload the file separately, and then store a URL that could be used to access that file in the actual form field being sent to HubSpot.

…you can pass a file URL through the Forms API, but it won’t automatically upload the file to the HubSpot file manager like it does when you manually submit a form.

That said, you can upload hidden files to the file manager through this method.