# Uploading to the file manager using a custom module

**URL:** <https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [March 18, 2021, 8:43pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138 "2021-03-18T20:43:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewv86](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andrewv86/32/103714_2.png) [@andrewv86](https://community.hubspot.com/u/andrewv86)\
**Post date:** [March 18, 2021, 8:43pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/1 "2021-03-18T20:43:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 19, 2021, 7:50pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/2 "2021-03-19T19:50:24Z")

</div>

@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.](https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file)

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)

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 19, 2021, 8:26pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/3 "2021-03-19T20:26:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrewv86](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andrewv86/32/103714_2.png) [@andrewv86](https://community.hubspot.com/u/andrewv86)\
**Post date:** [March 21, 2021, 7:37pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/4 "2021-03-21T19:37:32Z")

</div>

> * * *
> 
> @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.](https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file)
> 
> 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](https://github.com/MrRio/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

---

<div class="post-metadata">

**Author:** ![TJoyce7](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce7/32/29892_2.png) [@TJoyce7](https://community.hubspot.com/u/TJoyce7)\
**Post date:** [March 22, 2021, 1:41pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/5 "2021-03-22T13:41:21Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 22, 2021, 2:43pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/6 "2021-03-22T14:43:59Z")

</div>

Looks like @tjoyce has many face on the Community 😉

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 22, 2021, 3:06pm UTC](https://community.hubspot.com/t/uploading-to-the-file-manager-using-a-custom-module/34138/7 "2021-03-22T15:06:36Z")

</div>

@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.
