---
title: "store a file in the file store"
method: PUT
path: "/mockserver/files/store"
tags: ["files"]
---

# store a file in the file store

`PUT /mockserver/files/store`

## Request

- Base URL: `http://localhost:1080`
- URL: `http://localhost:1080/mockserver/files/store`
- Auth: none declared

stores a file (text or base64-encoded binary) under the supplied name in the in-memory file store

## Request body

- FileStoreRequest: file to store in the in-memory file store
  - `name` string, required: name to store the file under
  - `content` string, required: file content, either plain text or base64-encoded when base64 is true
  - `base64` boolean: when true, content is treated as base64-encoded binary data

## Response `201`

file stored

- object
  - `name` string
  - `size` integer

## Other responses

- `400`: request body missing the required 'name' and 'content' fields, or empty body

---

[API](https://skmtc.dev/mock-server/apis/mockserver-api.md) · [All operations](https://skmtc.dev/mock-server/apis/mockserver-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mock-server/apis/mockserver-api/revisions/9239b693996e?raw)
