You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Downloads with the same suggested filename silently overwrite each other in the output dir #514
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.
Reproduced on current upstream (1.66.0-next, 489470e3bbf48a50bd8f4a59401d50cb531b5902) on Linux with Chrome, Chromium, Firefox and WebKit. Downloads reuse the site's suggested name, and saveAs() replaces the earlier file. The proposed fix adds opt-in ordinal naming to outputFile, as requested in the review of microsoft/playwright#43930: the first download keeps same.txt, and the next uses same-1.txt. Explicit user-supplied output filenames are unchanged.
Reproduction and verification
The CLI test serves two links with download="same.txt", pointing to text responses containing v1 and v2. It opens the page, clicks each link, checks the reported destination, and reads both saved files.
Without the fix, the second download reports .playwright-cli/same.txt instead of .playwright-cli/same-1.txt on all four browsers. With the fix, the destinations differ and both contents are preserved.
All runs were headless on Linux. The CLI save-as and shared file suites passed on Chrome, Chromium, Firefox and WebKit: 81 passed, 7 existing skips. npm run build and npm run flint passed.
Activity
microsoft-playwright-automation commentedon Nov 9, 2026
Hi, I'm the Playwright bot and I reproduced this.
Reproduced on current upstream (
1.66.0-next,489470e3bbf48a50bd8f4a59401d50cb531b5902) on Linux with Chrome, Chromium, Firefox and WebKit. Downloads reuse the site's suggested name, andsaveAs()replaces the earlier file. The proposed fix adds opt-in ordinal naming tooutputFile, as requested in the review of microsoft/playwright#43930: the first download keepssame.txt, and the next usessame-1.txt. Explicit user-supplied output filenames are unchanged.Reproduction and verification
The CLI test serves two links with
download="same.txt", pointing to text responses containingv1andv2. It opens the page, clicks each link, checks the reported destination, and reads both saved files.Without the fix, the second download reports
.playwright-cli/same.txtinstead of.playwright-cli/same-1.txton all four browsers. With the fix, the destinations differ and both contents are preserved.All runs were headless on Linux. The CLI save-as and shared file suites passed on Chrome, Chromium, Firefox and WebKit: 81 passed, 7 existing skips.
npm run buildandnpm run flintpassed.Draft PR: microsoft/playwright#44011
Triaged on Linux by the Playwright bot - agent run
chore: mark v0.1.24 (#529)