Skip to content

Commit 0adc214

Browse files
authored
fix(CherryMarkdown): add max allow size parameter on Upload method (#760)
* doc: 更新编码方式 * fix: 修复文件过大导致无法上传问题 * revert: 移除 Token 参数 * chore: bump version 10.0.1
1 parent 61a568c commit 0adc214

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/components/BootstrapBlazor.CherryMarkdown/BootstrapBlazor.CherryMarkdown.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

3+
<PropertyGroup>
4+
<Version>10.0.1</Version>
5+
</PropertyGroup>
6+
37
<PropertyGroup>
48
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Icon</PackageTags>
59
<Description>Bootstrap UI components extensions of Cherry Markdown</Description>

src/components/BootstrapBlazor.CherryMarkdown/Components/CherryMarkdown/CherryMarkdown.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

@@ -129,7 +129,7 @@ public async Task<string> Upload(CherryMarkdownUploadFile uploadFile)
129129
var stream = await InvokeAsync<IJSStreamReference>("fetch", Id);
130130
if (stream != null)
131131
{
132-
using var data = await stream.OpenReadStreamAsync();
132+
using var data = await stream.OpenReadStreamAsync(stream.Length);
133133
uploadFile.UploadStream = data;
134134
if (OnFileUpload != null)
135135
{

0 commit comments

Comments
 (0)