API /export/zip Endpoint Returns HTML Instead of Valid ZIP (BookStack v25.02.2) #5349

Closed
opened 2026-02-05 09:59:37 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @southeasterntech on GitHub (Jul 9, 2025).

Describe the Bug

Description:

When using the BookStack API to export a book using the /export/zip endpoint, the response returns an .html document instead of a valid .zip archive. Attempting to unzip the resulting file produces the following error:

End-of-central-directory signature not found.
Either this file is not a zipfile, or it constitutes one disk of a multi-part archive.
Inspecting the file contents confirms it is an HTML page (starting with ) rather than a ZIP archive.

Steps to Reproduce

Steps to Reproduce:

Generate a valid API token with full access.

Run the following curl command:

bash

curl -L -H "Authorization: Token <YOUR_API_ID>:<YOUR_API_SECRET>"
https://your.bookstack.url/api/books/{book_id}/export/zip
-o bookstack-portable.zip
Attempt to unzip:

bash

unzip -l bookstack-portable.zip
Expected Behavior:
A valid .zip archive containing a portable export of the book.

Expected Behaviour

Zip file returned

Screenshots or Additional Context

Actual Behavior:
An HTML document is returned instead of a .zip file.

System Info:

BookStack Version: v25.05.2

PHP Version: php8.3.19

OS: Ubuntu 22.04 LTS

Reverse Proxy in use: No

-Can reproduce on local machine, with loopback 127.0.0.1 as well... so network not a factor

Browser Details

Brave\Chrome

Exact BookStack Version

25.05.2

Originally created by @southeasterntech on GitHub (Jul 9, 2025). ### Describe the Bug Description: When using the BookStack API to export a book using the /export/zip endpoint, the response returns an .html document instead of a valid .zip archive. Attempting to unzip the resulting file produces the following error: End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. Inspecting the file contents confirms it is an HTML page (starting with <!DOCTYPE html>) rather than a ZIP archive. ### Steps to Reproduce Steps to Reproduce: Generate a valid API token with full access. Run the following curl command: bash curl -L -H "Authorization: Token <YOUR_API_ID>:<YOUR_API_SECRET>" \ https://your.bookstack.url/api/books/{book_id}/export/zip \ -o bookstack-portable.zip Attempt to unzip: bash unzip -l bookstack-portable.zip Expected Behavior: A valid .zip archive containing a portable export of the book. ### Expected Behaviour Zip file returned ### Screenshots or Additional Context Actual Behavior: An HTML document is returned instead of a .zip file. System Info: BookStack Version: v25.05.2 PHP Version: php8.3.19 OS: Ubuntu 22.04 LTS Reverse Proxy in use: No -Can reproduce on local machine, with loopback 127.0.0.1 as well... so network not a factor ### Browser Details Brave\Chrome ### Exact BookStack Version 25.05.2
OVERLORD added the 🐛 Bug label 2026-02-05 09:59:37 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 9, 2025):

Hi @southeasterntech,
There is currently no /export/zip API endpoint, so you're getting the standard 404 view in response.
Probably something that will be part of the next feature release though, once I've reviewed #5592.

@ssddanbrown commented on GitHub (Jul 9, 2025): Hi @southeasterntech, There is currently no `/export/zip` API endpoint, so you're getting the standard 404 view in response. Probably something that will be part of the next feature release though, once I've reviewed #5592.
Author
Owner

@southeasterntech commented on GitHub (Jul 10, 2025):

ah ok, probably part of my problem! thank you!

@southeasterntech commented on GitHub (Jul 10, 2025): ah ok, probably part of my problem! thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5349