Skip to content

Downloading a .docx file through docsify dev server corrupts file #1918

Open
@sclarke500

Description

Bug Report

Downloading a linked a .docx Word file adds bites to file and corrupts it.

Sounds like it may be similar to this issue

Steps to reproduce

  • create a link to a word file: [test file](templates/test.docx ':ignore')
  • run docsify serve
  • click the link, then click on the downloaded file

What is current behaviour

Opening downloaded file causes "Word found unreadable content.." message.

My test file is 12kb, but the copy in downloads folder is 20kb

What is the expected behaviour

Downloaded file would be same as source

Other relevant information

link looks fine when inspecting element:
<a href="templates/test.docx" target="_blank" rel="noopener">test file</a>

Download functions correctly when docs are viewed via github pages (and in the sandbox linked below) - only see the issue when using docsify dev server (so not impacting use - just confused me for a bit while writing the docs)

This stackoverflow question discusses similar behavior with an ASP.NET server.

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Win 11

  • Node.js version: 16.13.2

  • npm/yarn version: npm 8.1.2

  • Browser version: Chrome 106/Firefox 106 (same issue in both)

  • Docsify version: 4.4.4

  • Docsify plugins: n/a

Please create a reproducible sandbox

Note: The download works in the sandbox test - assuming because the sandbox does not use the dev server

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

unknown

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions