File tree 4 files changed +36
-1
lines changed
4 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 10
10
<ItemGroup >
11
11
<PackageReference Include =" Serilog.AspNetCore" Version =" 6.1.0" />
12
12
13
- <PackageReference Include =" DryIoc.Microsoft.DependencyInjection" Version =" 6.1.1 " />
13
+ <PackageReference Include =" DryIoc.Microsoft.DependencyInjection" Version =" 6.2.0-preview-01 " />
14
14
<!-- <ProjectReference Include="..\..\src\DryIoc.Microsoft.DependencyInjection\DryIoc.Microsoft.DependencyInjection.csproj" /> -->
15
15
</ItemGroup >
16
16
Original file line number Diff line number Diff line change
1
+ @page " /upload"
2
+
3
+ <InputFile OnChange =" UploadFile" />
4
+
5
+ @_newDocumentUploadProgress %
6
+ @code {
7
+ private double _newDocumentUploadProgress ;
8
+ private async Task UploadFile (InputFileChangeEventArgs args )
9
+ {
10
+ var file = args .File ;
11
+ await using var uploadStream = file .OpenReadStream (maxAllowedSize : 10 * 1024 * 1024 );
12
+ var bytesRead = 0 ;
13
+ var totalRead = 0 ;
14
+ var buffer = new byte [10 ];
15
+ await using var memStream = new MemoryStream ();
16
+
17
+ while ((bytesRead = await uploadStream .ReadAsync (buffer )) != 0 )
18
+ {
19
+ totalRead += bytesRead ;
20
+
21
+ await memStream .WriteAsync (buffer , 0 , bytesRead );
22
+
23
+ _newDocumentUploadProgress = (totalRead / uploadStream .Length ) * 100 ;
24
+ StateHasChanged ();
25
+ }
26
+
27
+ memStream .Position = 0 ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change 24
24
<span class =" oi oi-list-rich" aria-hidden =" true" ></span > Fetch data
25
25
</NavLink >
26
26
</div >
27
+ <div class =" nav-item px-3" >
28
+ <NavLink class =" nav-link" href =" upload" >
29
+ <span class =" oi oi-cloud-upload" aria-hidden =" true" ></span > Upload file
30
+ </NavLink >
31
+ </div >
27
32
</nav >
28
33
</div >
29
34
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public static void Main()
13
13
// todo: @wip
14
14
// new GHIssue565_Is_ignoring_ReuseScoped_setting_expected_behaviour_when_also_set_to_openResolutionScope().Run();
15
15
16
+ // new IssuesTests.Samples.DefaultReuseTest().Run();
16
17
// new PropertyResolutionTests().Run();
17
18
// new GHIssue391_Deadlock_during_Resolve().Run();
18
19
// new GHIssue559_Possible_inconsistent_behaviour().Run();
You can’t perform that action at this time.
0 commit comments