BlazorInputFile icon indicating copy to clipboard operation
BlazorInputFile copied to clipboard

can't reset the stream

Open larseggan opened this issue 6 years ago • 4 comments

After reading the file e.g. CountLines(), I can't reset the stream with .Position, CanSeek is false. Any workaround?

larseggan avatar Oct 20 '19 16:10 larseggan

similar to this, is there a way to simply reset the control? dispose of the stream/IFileListEntry[] on the input so it'll read as if 'No file chosen' again?

davidsandusky avatar Jan 23 '20 22:01 davidsandusky

Having the same problem here. Did anyone find a solution? Thanks.

oscardeharo avatar Apr 16 '20 15:04 oscardeharo

I consider this more of a hack than a solution, but the wrapper I wrote for inputfile has an OnReset method, which shows a 'Reset' button, you can change the text with ResetButtonName.

There is a Sample page here also, maybe it will help someone:

Source https://github.com/DataJuggler/BlazorFileUpload

Nuget: DataJuggler.Blazor.FileUpload

DataJuggler avatar Apr 16 '20 15:04 DataJuggler

@oscardeharo I copied the file to a memorystream, that worked well.

larseggan avatar Apr 16 '20 16:04 larseggan