APIs & Integrations

PieterVHeerden
Member

Could not determine name from file

Hi all,

I am using the following API to upload a file using postman

/files/v3/files

 

I am using this as my guideline : https://developers.hubspot.com/docs/api/files/files

 

When i select a file, it creates the file in CRM

When i change the file paramater to text (and add my base64 string), i get the above error.

 

Even if i add the fileName paramater, it says the same thing.

 

Any help would be appreciated. I know it is something very small

 

Thanks

4 Replies 4
AKemeklis
Member

Could not determine name from file

Hey,

 

I am also having the same issue.

Screenshot 2023-08-28 at 14.33.15.png

Screenshot 2023-08-28 at 14.33.55.png


I am passing a Base64 encored file (this is the only part I am not fully sure of).

But other than that, everything is according to the docs. I run plenty of API calls through Hubspot with the same authentication so I assume that's not the problem either.

is there any way we can get help?

 

Jaycee_Lewis
Community Manager
Community Manager

Could not determine name from file

Hey, @PieterVHeerden 👋 Thanks for your question! 

I don't see an error message in your post. Can you add it here as a reply? Pasting it in and using the code block tool is best, as extracting the error messages and searching with them is hard with from just a screenshot. 

 

  • I have a few questions:
  • Could you please provide the full error message you're encountering? This can often give us more insight into what's going wrong.
  • Can you share a sample of your request, including the URL, headers, and body, along with the response you receive? You can just copy and paste this from Postman. Please remember to exclude any sensitive information.
  • Are you confident that your base64 string is a valid representation of the file you're trying to upload? Mis-formatted or corrupted base64 strings can cause issues when uploading files.

 

Thank you! — Jaycee 

 

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
PieterVHeerden
Member

Could not determine name from file

Hi Jaycee,

Please see below. If i upload a file in postman it works. once I change file to be text in the body, that is when it fails. If i add fileName in the body, this yields the same error

  • Could you please provide the full error message you're encountering? This can often give us more insight into what's going wrong.
    • {
          "status": "error",
          "message": "Could not determine name from file",
          "correlationId": "3460cb4a-1540-403d-99af-5cad3692bcfa",
          "category": "BAD_REQUEST"
      }
  • Can you share a sample of your request, including the URL, headers, and body, along with the response you receive? You can just copy and paste this from Postman. Please remember to exclude any sensitive information.
    • Params = nothing
    • POST
    • {{baseUrl}}/files/v3/files
    • Auth = Bearer Token
    • PieterVHeerden_0-1684991766707.png

       

    • Body
      • Form Data
      • file = <== add your own base64 string
      • folderPAth = /
      • options
        • {"access":"PRIVATE","overwrite":false,"duplicateValidationStrategy":"NONE","duplicateValidationScope":"ENTIRE_PORTAL"}
  • Are you confident that your base64 string is a valid representation of the file you're trying to upload? Mis-formatted or corrupted base64 strings can cause issues when uploading files <== Yes if i take the same sting in C# then it uploads

 

Thanks

jeff00seattle
Contributor

Could not determine name from file

Any luck?

I am experiencing the same issue.