question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use the Upload control to call the Stream API

See original GitHub issue

Microsoft Demo

InputFile Control:

    private async void LoadFiles(InputFileChangeEventArgs e)
    {
            using var memoryStream = new MemoryStream();
            Stream fs =e.File.OpenReadStream();
            await fs.CopyToAsync(memoryStream);
            Assembly assembly = Assembly.Load(memoryStream.ToArray());
    }

Upload Control:

    private async void OnSingleCompleted(AntDesign.UploadInfo uploadInfo)
    {
          Stream fs =uploadInfo.File.OpenReadStream();
          await fs.CopyToAsync(memoryStream);
          Assembly assembly = Assembly.Load(memoryStream.ToArray());
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
SmRileycommented, Dec 4, 2021

Currently used with built-in ,but ugly😂, this Upload control is not intended to support?inputfile

maybe u can use that :

<span class="ant-upload-picture-card-wrapper">
    <label class="avatar-uploader" for="upload">
        <div class="ant-upload ant-upload-select-picture-card ant-upload-select">
            <div tabindex="0" class="ant-upload" style="position:relative;">
                <InputFile id="upload" hidden/>
                <div>
                    <Icon Spin="loading" Type="@(loading?"Loading":"plus")"></Icon>
                    <div className="ant-upload-text">Upload</div>
                </div>
            </div>
        </div>
    </label>
</span>
3reactions
ElderJamescommented, Jan 17, 2023

Hello @SmallChi , now we support use built-in InputFile with Upload.

https://antblazor.com/en-US/components/upload#components-upload-demo-input-file

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to upload a file using commons file upload streaming api
Use this in your HTML file: <form action="UploadController" enctype="multipart/form-data" method="post"> <input type="file"> </form>.
Read more >
Uploading Streams of Data
Create the upload task with the URLSession method uploadTask(withStreamedRequest:) . This takes a URLRequest specifying the URL you want to upload to, along ......
Read more >
File upload and streams using Minimal API
Uploading files using IFormFile and IFormFileCollection​​ app. MapPost("/upload", async(IFormFile file) => { string tempfile = CreateTempfilePath ...
Read more >
Upload files in ASP.NET Core
Upload large files with streaming. The 3.1 example demonstrates how to use JavaScript to stream a file to a controller action. The file's...
Read more >
.Net SDK upload file API, requires that the stream must be ...
I am using "UploadPartRequest" and "PutObjectRequest" but both of these requests do not work even by setting following parameters: DisablePayloadSigning = true, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found