-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
This may not be a bug, but after 3 days of trying your IBrowserFile returned by the InputFile component for blazor does not have a SaveAsAsync feature.
Your stream that is returned does not have any way to save. When I try to convert the stream to a FileStream, I get a Task was cancelled whether or not I use a cancellation token.
Why would you not design this component to use a System.IO.File object, so you can easily be saved?
Please provide an easy example of saving the file uploaded to the upload folder in Blazor. Your Sample provided uses a Person object, which has a Picture property which is an IBrowserFile, which is the problem I am having. I saw someone had an example of how to save to a BlobStorage with blob.UploadAsync(), so if that can be done, IBrowserFile.SaveAsync(path) would be the simplest solution.
My code is here if you can tell me how to update this Nuget package to .Net 5 I will update it, else I have to stay on .Net Standard for file uploads.
(this may or may not be converted to .Net 5, not sure if I checked in what ISN"T WORKING).
https://github.com/DataJuggler/BlazorFileUpload
Really don't see why IBrowserFile was created if it doesn't have SaveAsAsync is it useless, and I have to stay on Steve Sanderson's BlazroFileInput which hasn't been updated since Preview 3 of Blazor.
Thank you, I wasted a weekend and can't waste any more time. Your stream object is not easy to work with, nor is IBrowserFile.
Steve Sanderson's Blazor File Input worked out of the box, I never had any problems till I tried to switch to .Net 5.
Thank you, this is a bug, not a feature request, because if it worked, I wouldn't be here.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Exceptions (if any)
Further technical details
- ASP.NET Core version
- Include the output of
dotnet --info
- The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version