Explain GetRandomFileName /2 (#24058)

pull/24061/head
Rick Anderson 2021-11-24 11:58:47 -10:00 committed by GitHub
parent 2356ddd531
commit f6fda79c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -359,6 +359,8 @@ public class FilesaveController : ControllerBase
} }
``` ```
In the preceding code, <xref:System.IO.Path.GetRandomFileName%2A> is called to generate a secure filename. Never trust the filename provided by the browser, as an attacker may choose an existing filename that overwrites an existing file or send a path that attempts to write outside of the app.
## File streams ## File streams
::: zone pivot="webassembly" ::: zone pivot="webassembly"