docs: add a note on download file name (#7473)

This commit is contained in:
Yury Semikhatsky 2021-07-07 10:37:24 -07:00 committed by GitHub
parent 47885db116
commit a481de0871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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

4
types/types.d.ts vendored
View File

@ -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<null|string>;