# File Uploads

Since Frisby.js is based on the Fetch API, file uploads are a cinch with the built-in FormData object (see [Using FormData Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects) if you are not familiar with them).

You can get a new FormData object from Frisby:

```
let formData = frisby.formData();
```

A full usage example might look like this:

```
const csvPath = path.resolve(__dirname, './file.csv');
let content = fs.createReadStream(csvPath);
let formData = frisby.formData();

formData.append('file', content);

return frisby
  .post('http://api.example.com/files', { body: formData })
  .inspectRequestHeaders()
  .expect('status', 200)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.frisbyjs.com/api-and-usage/file-uploads-with-frisbyjs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
