Skip to content

Commit

Permalink
aspnet#65 Completed JS file in BinarySubmit sample
Browse files Browse the repository at this point in the history
  • Loading branch information
CK-Yong committed Jun 5, 2021
1 parent ae4ae5d commit d9a83d7
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
5 changes: 2 additions & 3 deletions samples/aspnetcore/blazor/BinarySubmit/ChunkedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ public override async ValueTask<int> ReadAsync(Memory<byte> buffer, Cancellation
return 0;
}


var bytes = await _js.InvokeAsync<byte[]>("readBytes", _readBytes);

if (_maxAllowedLength - _readBytes < bytes.Length)
{
throw new InvalidDataException("Too many bytes read.");
Expand All @@ -61,7 +60,7 @@ public override async ValueTask<int> ReadAsync(Memory<byte> buffer, Cancellation

bytes.AsMemory().CopyTo(buffer);
_readBytes += bytes.Length;

return bytes.Length;
}

Expand Down
1 change: 1 addition & 0 deletions samples/aspnetcore/blazor/BinarySubmit/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="BinarySubmit.styles.css" rel="stylesheet" />
<script src="BinarySubmit.js"></script>
</head>
<body>
<component type="typeof(App)" render-mode="ServerPrerendered" />
Expand Down
56 changes: 56 additions & 0 deletions samples/aspnetcore/blazor/BinarySubmit/wwwroot/BinarySubmit.js

Large diffs are not rendered by default.

0 comments on commit d9a83d7

Please sign in to comment.