---
title: Answer a request with a file
project: TotalTraffic
version: Latest
section: guides
language: en
license: 
url: https://totaljs.es/docs/totaltraffic/latest/guides/answer-with-a-file/
updated: 2026-12-02T15:40:21.062Z
---

# Answer a request with a file

> Give an app the answer that you want from a file of your computer. The server is not asked, so you can work with data that it does not have yet, or without it.

## Make the rule

1. Right-click a request and choose **Answer it with a file…**
2. Press **Choose the file…** and choose it.
3. Change the **Status** if you need another than `200`. It goes from 100 to 599.
4. Leave **Content type** empty to use the one of the name of the file, or write it, such as `application/json`.
5. Look at the [addresses that it fits](/totaltraffic/latest/guides/rules/#which-requests-it-fits) and press **Keep the rule**.

The next time that the app asks for that address, it gets the file. The request says **rule** in the list, and **Answered from …** when you open it.

## Change the answer

Edit the file and save it. TotalTraffic reads it each time, so the next request has the new content.

To start from the real answer, choose the request, copy the body in **Answer**, and paste it in a new file.

## What to know

- The file can have up to 64 MB.
- The type is known for JSON, HTML, JavaScript, CSS, text, XML, SVG, PNG, JPEG, GIF, WebP, icons, WOFF2 fonts, PDF and WebAssembly. For others, write it.
- The answer has no other headers than its type and its length. A browser that asks from a page of another domain refuses it, because the headers that allow it are not there.
- An answer from a file is not paused, even if another rule pauses the answers of that address.

If you move or delete the file, the app gets an error 502 that says so. Change the rule, or remove it.
