# files/v3/files error

**URL:** <https://community.hubspot.com/t/files-v3-files-error/38515>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [June 7, 2021, 10:49pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515 "2021-06-07T22:49:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CRedmon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/credmon/32/44934_2.png) [@CRedmon](https://community.hubspot.com/u/CRedmon)\
**Post date:** [June 7, 2021, 10:49pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515/1 "2021-06-07T22:49:19Z")

</div>

Hello,

I am trying to create a file using the new /files/v3/files API. When I am passing in the formData to the API I am getting the following reponse:

{

status: ‘error’,

message: ‘Could not determine name from file’,

correlationId: ‘473023e1-6489-450e-81ed-feacdc2fbfb7’,

category: ‘BAD\_REQUEST’

}

I am creating the file and then planning on attaching the file to note to append to deals.

Could you give me some insight on this?

Thanks!

---

<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:** [June 8, 2021, 3:11pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515/2 "2021-06-08T15:11:58Z")

</div>

@CRedmon ,

Mind adding the json body as well as the full request uri that you are submitting to? (minus a hapikey)

@tominal maybe able to assist when there are more details 😀

---

<div class="post-metadata">

**Author:** ![CRedmon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/credmon/32/44934_2.png) [@CRedmon](https://community.hubspot.com/u/CRedmon)\
**Post date:** [June 8, 2021, 4:26pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515/3 "2021-06-08T16:26:33Z")

</div>

Hi @dennisedson ,  
I am submitting form data to the api because it is a “multipart/form-data” so here is the best I can do.  
FormData object:

{

file: \<buffer\>,  
fileName: \<string\>,  
options:

{

```
    access: "PUBLIC\_INDEXABLE",

    ttl: "P3M",

   overwrite: false,

  duplicateValidationStrategy: "NONE",

  duplicateValidationScope: "ENTIRE\_PORTAL",

}

```

}

From Axios request:  
url: ‘/files/v3/files’,

```
method: 'post',

data: FormData {

  \_overheadLength: 425,

  \_valueLength: 4297,

  \_valuesToMeasure: \[],

  writable: false,

  readable: true,

  dataSize: 0,

  maxDataSize: 2097152,

  pauseStreams: true,

  \_released: true,

  \_streams: \[],

  \_currentStream: **null** ,

  \_insideLoop: false,

  \_pendingNext: false,

  \_boundary: '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-264236909180776376341869',

  \_events: \[Object: null prototype],

  \_eventsCount: 1

},

headers: {

  Accept: 'application/json, text/plain, \*/\*',

  'Content-Type': 'multipart/form-data; boundary=\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-264236909180776376341869',

  Authorization: 'Bearer \<valid oauth token>',

  'User-Agent': 'axios/0.21.1'

},

baseURL: 'https://api.hubapi.com/',

```

---

<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:** [June 8, 2021, 4:57pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515/4 "2021-06-08T16:57:57Z")

</div>

Throwing @tjoyce into this as well 😀

---

<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:** [June 9, 2021, 10:14am UTC](https://community.hubspot.com/t/files-v3-files-error/38515/5 "2021-06-09T10:14:40Z")

</div>

@CRedmon - Does my answer on this post help you out?

[https://community.hubspot.com/t5/APIs-Integrations/Can-t-get-file-upload-via-file-API-to-work-please-help/m-p/426872#M42413](https://community.hubspot.com/t5/APIs-Integrations/Can-t-get-file-upload-via-file-API-to-work-please-help/m-p/426872#M42413)

---

<div class="post-metadata">

**Author:** ![CRedmon](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/credmon/32/44934_2.png) [@CRedmon](https://community.hubspot.com/u/CRedmon)\
**Post date:** [June 9, 2021, 12:02pm UTC](https://community.hubspot.com/t/files-v3-files-error/38515/6 "2021-06-09T12:02:44Z")

</div>

@tjoyce Hi! I am not a php developer but after looking at your post I did some digging and found what I was missing. In my form body I was missing another parameter on the file property to pass the filename (hence my error).

For all the nodejs devs out there:

```lia-code-sample
const bodyFormData = new FormData();
 bodyFormData.append("file", file.content, { filename: file.filename });
 bodyFormData.append("folderPath", folderPath);
 bodyFormData.append(
 "options",
 JSON.stringify({
 access: "PRIVATE",
 overwrite: true,
 duplicateValidationStrategy: "NONE",
 duplicateValidationScope: "EXACT_FOLDER",
 })
 );

 return _api
 .post("/files/v3/files", bodyFormData, {
 headers: {
 Authorization: `Bearer ${token}`,
 ...bodyFormData.getHeaders(),
 },
 })
 .then(({ data }) => data)
 .catch(e => {
 console.log(e);
 throw new Error(
 `Failed getting creating file ${e.response?.status} - ${e.response?.statusText} - ${e.response?.data?.message}`
 );
 });

```
