Uploading to the file manager using a custom module

I have a custom module which outputs an auto generated PDF, but I have no way to handle the file without using a storage solution like Amazon S3. Is there a way to have the file uploaded into the file manager within a custom module?

@andrewv86

A: cool!

B: I believe you would have to build your own app to process the file if you want it to go to HubSpot file manager using this api.

You will need to use an api key and you do not want that exposed.

@tjoyce is a talented young man who might have some better ideas. 9 times out of 10, he does (and I relish that 1 time where mine is better)

@andrewv86 - How are you auto generating a pdf if the end result of the generated pdf isn’t stored on a server somewhere already?


@dennisedson wrote:

@andrewv86

A: cool!

B: I believe you would have to build your own app to process the file if you want it to go to HubSpot file manager using this api.

You will need to use an api key and you do not want that exposed.

@tjoyce is a talented young man who might have some better ideas. 9 times out of 10, he does (and I relish that 1 time where mine is better)


@dennisedson I’ve been toying with the idea of using my own app to access those APIs, it would be nice to have a solution working solely in a custom module but that may be the closest solution.


@tjoyce wrote:

@andrewv86 - How are you auto generating a pdf if the end result of the generated pdf isn’t stored on a server somewhere already?


@tjoyce Using a tool called jsPDF, you can autogenerate a pdf in JavaScript. From there it is treated as a blob file that is held in the browser, and then it can be downloaded or used any way you like

@andrewv86 - gotcha, unfortunately to get them into the file manager, you will have to use a server.

If the pdf’s are linked to a contact, there’s a possibility you could put a form with a file input into the page and then put the pdf into the form upload and send it as a contact property.

Looks like @tjoyce has many face on the Community :wink:

@dennisedson - Sadly, I have 7 HS logins and the new community doesn’t remember your login, so if you forget to logout and login to the right one… you get the idea… it’s a real pain.