Skip to content

Commit a080b58

Browse files
Adapt changes to InputFile docs (#3764) (#3768)
1 parent e0a4219 commit a080b58

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

examples/Demo/FluentUI.Demo.Client/Documentation/Components/InputFile/FluentInputFile.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The component can be customized by adapting the `ChildContent`.
1919
The areas that need to be associated with the opening of the file selection dialog
2020
must be included in a `label for` that references the component `Id`: E.g. `<label for=“my-file-uploader”>browse...</label>`.
2121

22+
> ℹ️ By default, this component uses the `SaveToTemporaryFolder` mode, which creates a local file. However, this might not always be possible depending on the user's permissions on the host system. You may need to change the `InputFileMode` based on your specific use case.
23+
2224
{{ InputFileDefault }}
2325

2426
## Manual upload
@@ -34,12 +36,16 @@ By default, the component has a parameter `Mode=“InputFileMode.SaveToTemporary
3436
Change this parameter to `InputFileMode.Buffer` to control the reception of files directly into memory.
3537
When the `OnCompleted` event is triggered, the entire file content is present in the `file.Buffer` property.
3638

39+
This mode is recommended if you can't store files locally, are working with small files, and have enough memory.
40+
3741
{{ InputFileBufferMode }}
3842

3943
## Mode = InputFileMode.Stream
4044

4145
If you want to transfer very large files and do not want to save your files locally (in a temporary folder, for example),
42-
you can retrieve the file stream from the `OnFileUploaded` event and the `file.Stream` property.
46+
you can retrieve the file stream from the `OnFileUploaded` event and the `file.Stream` property. Keep in mind that you will need to implement stream handling yourself.
47+
48+
> ⚠️ Remember to always dispose each stream to prevent memory leaks!
4349
4450
{{ InputFileStream }}
4551

src/Core/Components/InputFile/FluentInputFile.razor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ public FluentInputFile()
7575

7676
/// <summary>
7777
/// Gets or sets the maximum size of a file to be uploaded (in bytes).
78-
/// Default value is 10 MB.
78+
/// Default value is 10 MiB.
7979
/// </summary>
8080
[Parameter]
8181
public long MaximumFileSize { get; set; } = 10 * 1024 * 1024;
8282

8383
/// <summary>
8484
/// Gets or sets the sze of buffer to read bytes from uploaded file (in bytes).
85-
/// Default value is 10 KB.
85+
/// Default value is 10 KiB.
8686
/// </summary>
8787
[Parameter]
8888
public uint BufferSize { get; set; } = 10 * 1024;
@@ -106,6 +106,7 @@ public FluentInputFile()
106106
/// Gets or sets the type of file reading.
107107
/// For SaveToTemporaryFolder, use <see cref="FluentInputFileEventArgs.LocalFile" /> to retrieve the file.
108108
/// For Buffer, use <see cref="FluentInputFileEventArgs.Buffer" /> to retrieve bytes.
109+
/// For Stream, use <see cref="FluentInputFileEventArgs.Stream"/> to have full control over retrieving the file.
109110
/// </summary>
110111
[Parameter]
111112
public InputFileMode Mode { get; set; } = InputFileMode.SaveToTemporaryFolder;

0 commit comments

Comments
 (0)