From a481de0871f02421eea9075246dcbb35d19a111e Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 7 Jul 2021 10:37:24 -0700 Subject: [PATCH] docs: add a note on download file name (#7473) --- docs/src/api/class-download.md | 3 +++ types/types.d.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/docs/src/api/class-download.md b/docs/src/api/class-download.md index 05f8f654c8..d5b4ba336d 100644 --- a/docs/src/api/class-download.md +++ b/docs/src/api/class-download.md @@ -93,6 +93,9 @@ Get the page that the download belongs to. Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if necessary. The method throws when connected remotely. +Note that the download's file name is a random GUID, use [`method: Download.suggestedFilename`] +to get suggested file name. + ## async method: Download.saveAs Copy the download to a user-specified path. It is safe to call this method while the download diff --git a/types/types.d.ts b/types/types.d.ts index 9391053fef..9c473a432c 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -9624,6 +9624,10 @@ export interface Download { /** * Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if * necessary. The method throws when connected remotely. + * + * Note that the download's file name is a random GUID, use + * [download.suggestedFilename()](https://playwright.dev/docs/api/class-download#download-suggested-filename) to get + * suggested file name. */ path(): Promise;