# DocxReader and PPTXReader read FastAPI uploads, plus read_file and C# fixes

> Agno's DocxReader and PPTXReader now read FastAPI uploads and other temporary streams, and this release fixes read_file line limits and C# headings.

- Published: 2026-11-17
- Author: Rudy Mizrahi Celekli
- Categories: Changelog
- Canonical: https://www.agno.com/blog/docxreader-and-pptxreader-read-fastapi-uploads-plus-read-file-and-c-fixes
- Markdown: https://www.agno.com/blog/docxreader-and-pptxreader-read-fastapi-uploads-plus-read-file-and-c-fixes.md

Agno's `DocxReader` and `PPTXReader` now return the text of Word and PowerPoint files uploaded through FastAPI. This release also fixes `read_file` in `FileTools` and `Workspace`, and C# headings in `PageMarkdownChunking`. We ran each fix on this release and the previous one with real files and no model.

## Word and PowerPoint uploads keep their content

A Word file uploaded through FastAPI reaches your code as a `SpooledTemporaryFile`, and `DocxReader` handed back an empty list for it. Python's temporary streams report a `name` of `None` or an integer, and the reader called `.split()` on that name after parsing the file, so the reader logged the error and dropped the content. `DocxReader` and `PPTXReader` now fall back to the names `docx_file` and `pptx_file` when a stream has no string name, in `read` and `async_read` alike, and a `name` you pass still wins.

```text
# real output, files built with python-docx and python-pptx, read from a SpooledTemporaryFile

DocxReader(chunk=False).read(stream)
Before  []  ERROR Error reading file: 'NoneType' object has no attribute 'split'
Now     [('docx_file', 'Quarterly report: revenue up 12%')]

PPTXReader(chunk=False).read(stream)
Before  []
Now     [('pptx_file', 'Slide 1:\nQuarterly report: revenue up 12%')]
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/07_knowledge/09_archive/readers/pptx_reader.py), and learn more about [readers](https://docs.agno.com/knowledge/concepts/readers/overview) in the documentation.

## read_file returns a file at its line limit

An agent with `max_file_lines=5` could not read a five-line file, because the file ended in a newline. `FileTools.read_file` and `Workspace.read_file` both counted the empty piece after that final newline as one more line. Both now treat a trailing line separator as the end of the last line, and `Workspace` reports the file's real count when it refuses a longer one.

```text
# real output, notes.txt holds five lines and a trailing newline

FileTools(max_file_lines=5).read_file("notes.txt")
Before  Error reading file: file too long. Use read_file_chunk instead
Now     'one\ntwo\nthree\nfour\nfive\n'
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/file_tools.py), and learn more about [FileTools](https://docs.agno.com/tools/toolkits/local/file) and [Workspace](https://docs.agno.com/tools/toolkits/local/workspace) in the documentation.

## C# headings keep their hash

A docs page titled `# C#` came out of `PageMarkdownChunking` with the breadcrumb `C`, and its `## Using F#` section became `C › Using F`. The heading pattern read any trailing `#` as a closing sequence. `PageMarkdownChunking` now treats trailing hashes as closing only after a space or tab, following CommonMark's rule for ATX headings, so `C#`, `F#` and `C##` survive in the breadcrumb and in the context line that opens every chunk.

```text
# real output, PageMarkdownChunking().chunk() on "# C#" with a "## Using F#" section

Before  breadcrumbs ['C', 'C › Using F'], context line 'C: Language guide.'
Now     breadcrumbs ['C#', 'C# › Using F#'], context line 'C#: Language guide.'
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/27_public_pages/documentation_markdown.py), and learn more about [published pages](https://docs.agno.com/reference/knowledge/pages) in the documentation.
