Skip to content

Downloads with the same suggested filename silently overwrite each other in the output dir #514

Open

Description

Downloads are saved to <outputDir>/<suggestedFilename>. Unlike screenshots, snapshots and storage-state files, which get timestamped names, a second download with the same suggested name replaces the first. Both responses report the same path, so the first file is lost without any warning. Sites commonly reuse names such as invoice.pdf, export.csv or report.xlsx.

Steps to reproduce

<!-- dl.html -->
<a href="data:text/plain,v1" download="same.txt">V1</a>
<a href="data:text/plain,v2" download="same.txt">V2</a>
playwright-cli open http://127.0.0.1:8765/dl.html
playwright-cli click 'text=V1'   # Downloaded file same.txt to ".playwright-cli/same.txt"
playwright-cli click 'text=V2'   # Downloaded file same.txt to ".playwright-cli/same.txt"
cat .playwright-cli/same.txt     # v2

Expected

The second download gets a unique name (for example same-1.txt, the way video files get a -1 suffix), and the event reports that path.

Environment

  • @playwright/cli 0.1.23 (main @ f50f579), playwright-core 1.65.0-alpha-2026-10-30
  • Node 22.23.4, Linux x64, Chrome for Testing 153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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