- AsyncDisposableStream
- BrowserFileReaderException
- DropEffect
- DropEventsOptions
- DropEventsOptionsExtensions
- FileReaderJsInterop
- FileReaderServiceOptions
- IBase64Stream
- IFileInfo
- IFilePositionInfo
- IFileReaderRef
- IFileReaderService
- IFileReaderServiceOptions
- IFileReference
- IObjectUrl
- PasteEventOptions
- PlatformConfig
- SetupExtension
Tewr.Blazor.FileReader
Stream that implements IAsyncDisposable
Inherit from parent.
This method has no parameters.
Tewr.Blazor.FileReader
Exception that is thrown if an exception occurs in the browser during file reader operations
Tewr.Blazor.FileReader.DropEvents
Possible values of the DataTransfer.dropEffect property
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect
A copy of the source item is made at the new location.
A link is established to the source at the new location.
An item is moved to a new location.
The item may not be dropped.
Tewr.Blazor.FileReader.DropEvents
If set to true, drop target file list becomes additive. Defaults to false.
Predefined global javascript function that will be executed on the dragover event. The method will be passed the following arguments: The DragEvent, the target element, and the FileReaderComponent instance.
Javascript function snippet that will be executed on the dragover event. The method will be passed the following arguments: The DragEvent, the target element, and the FileReaderComponent instance. Do not set this property using user-provided data, as it would be a security risk.
Predefined global javascript function that will be executed on the drop event. The method will be passed the following arguments: The Event, the target element, and the FileReaderComponent instance.
Javascript function snippet that will be executed on the drop event. The method will be passed the following arguments: The DragEvent, the target element, and the FileReaderComponent instance. Do not set this property using user-provided data, as it would be a security risk.
Predefined global javascript function that will be executed immediately after the drag and drop events have been registered. The method will be passed the following arguments: null, the target element, and the FileReaderComponent instance.
Javascript function snippet that will be executed immediately after the drag and drop events have been registered. The method will be passed the following arguments: null, the target element, and the FileReaderComponent instance. Do not set this property using user-provided data, as it would be a security risk.
Tewr.Blazor.FileReader.DropEvents
Sets the specified value on the dataTransfer property in the dragover event to the specified value.
Name | Type | Description |
---|---|---|
source | Tewr.Blazor.FileReader.DropEvents.DropEventsOptions | |
dropEffect | Tewr.Blazor.FileReader.DropEvents.DropEffect |
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect
Tewr.Blazor.FileReader
Called from Js
Name | Type | Description |
---|---|---|
taskId | System.Int64 |
Tewr.Blazor.FileReader
SignalR setting
Activates server-side buffer chunking. Activated if not running on WASM.
Tewr.Blazor.FileReader
Provides a base64-encoded string view of a sequence of bytes from a file.
Gets the length of the stream in bytes.
Gets or sets the current byte position in the Stream.
Asynchronously reads a sequence of bytes as a base64 encoded string from the current stream and advances the position within the stream by the number of bytes read.
The requested sequence of bytes as a base64 encoded string. The resulting string can be shorter than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be string.empty if the end of the stream has been reached.
Name | Type | Description |
---|---|---|
offset | System.Int32 | The byte offset in the source at which to begin reading data from the stream. |
count | System.Int32 | The maximum number of bytes to read. |
cancellationToken | System.Threading.CancellationToken |
Tewr.Blazor.FileReader
Provides properties for file metadata.
Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight).
Returns the last modified time of the file.
Returns the name of the file referenced by the File object.
Returns a list of non-standard DOM properties attached to the object, like the webkitRelativePath property.
Returns information of the position of any stream related to this file.
Returns the size of the file in bytes.
Returns the MIME type of the file.
Tewr.Blazor.FileReader
Provides information on the position of a Stream currently reading this file.
The underlying stream that was the source of the Position change.
The current position of a Stream currently reading this file, relative to the file size.
The delta between current Percentage and PercentageOnAcknowledge
The value of Percentage when Acknowledge was last called
The current position of a Stream currently reading this file.
The delta between current Position and what the value was at the last call to Acknowledge
The value of Position when Acknowledge was last called
Saves value of Position to PositionOnAcknowledge and Percentage to PercentageOnAcknowledge
This method has no parameters.
The saved values may also be comsumed as deltas from convenience properties PositionDeltaSinceAcknowledge and PercentageDeltaSinceAcknowledge
Tewr.Blazor.FileReader
Provides methods for interacting with an element that provides file streams.
Clears any value set on the source element
An awaitable Task representing the operation
This method has no parameters.
Enumerates the currently selected file references
An awaitable Task that provides an enumeration of the currently selected file references
This method has no parameters.
Register for drop events on the source element
An awaitable task representing the operation
Name | Type | Description |
---|---|---|
additive | System.Boolean | If set to true, drop target file list becomes additive. Defaults to false. |
Register for drop events on the source element
An awaitable task representing the operation
Name | Type | Description |
---|---|---|
dropEventsOptions | Tewr.Blazor.FileReader.DropEvents.DropEventsOptions | Provides expert options for manipulating the default javascript behaviour of the drag and drop events. |
Register for paste events on the source element
An awaitable task representing the operation
Name | Type | Description |
---|---|---|
additive | System.Boolean | If set to true, target file list becomes additive. Defaults to false. |
Register for paste events on the source element
An awaitable task representing the operation
Name | Type | Description |
---|---|---|
pasteEventOptions | Tewr.Blazor.FileReader.DropEvents.PasteEventOptions | Provides expert options for manipulating the default javascript behaviour of the paste events. |
Unregister drop events on the source element
An awaitable Task representing the operation
This method has no parameters.
Unregister paste events on the source element
An awaitable Task representing the operation
This method has no parameters.
Tewr.Blazor.FileReader
Servive for creating a IFileReaderRef instance from an element.
Creates a new instance of IFileReaderRef for the specified element.
a new instance of IFileReaderRef
Name | Type | Description |
---|---|---|
element | Microsoft.AspNetCore.Components.ElementReference | A reference to an element that can provide file streams. |
Should be obtained using the @ref attribute. | ||
Should reference either an input element of type file or a drop target. |
Explicitly initializes this instance by loading the neccessary interop code to the browser.
This method has no parameters.
Tewr.Blazor.FileReader
Provides configuration options for IFileReaderService
Initializes the file service on the first interop call. Redundant for client-side blazor.
Initializing on the first call is neccessary only if the javascript interop file (FileReaderComponent.js) has not been loaded manually using a script tag.
For client-side blazor, uses shared memory buffer to transfer data quickly. Not available for server-side blazor.
Tewr.Blazor.FileReader
Provides properties and instance methods for the reading file metadata and aids in the creation of Readonly Stream objects.
Convenience method to read the file fully into memory using a single interop call and returns it as a MemoryStream. Buffer size will be equal to the file size. The length of the resulting MemoryStream will be the same as the file size.
A MemoryStream representing the full file, with Position set to 0.
This method has no parameters.
In most cases the fastest way to read a file into ram, but also the method that uses the most memory. Will use at least twice the file size of memory at the end of the read operation.
Convenience method to read the file fully into memory using a single interop call and returns it as a MemoryStream. Buffer size will be equal to the file size. The length of the resulting MemoryStream will be the same as the file size.
A MemoryStream representing the full file, with Position set to 0.
This method has no parameters.
In most cases the fastest way to read a file into ram, but the most expensive in memory usage. Will use at least twice the file size of memory at the end of the read operation.
Convenience method to read the file fully into memory represented as a MemoryStream, using the specified bufferSize
.
The length of the resulting MemoryStream will be the same as the file size.
A MemoryStream representing the full file, with Position set to 0.
This method has no parameters.
Convenience method to read the file fully into memory represented as a MemoryStream, using the specified bufferSize
.
The length of the resulting MemoryStream will be the same as the file size.
A MemoryStream representing the full file, with Position set to 0.
This method has no parameters.
Returns the underlying file object as an IJSObjectReference
This method has no parameters.
Returns an object url for a file.
This method has no parameters.
Opens a read-only Stream to read the file.
A read-only Stream to read the file.
This method has no parameters.
Opens a read-only base64-encoded string stream to read the file
A read-only IBase64Stream to read the file.
This method has no parameters.
Reads the file metadata.
An object containing the file metadata
This method has no parameters.
Tewr.Blazor.FileReader
Represents an object url for a file.
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
Returns the Object Url.
Tewr.Blazor.FileReader.DropEvents
Provides expert options for manipulating the default behaviour of the paste event.
If set to true, paste target file list becomes additive. Defaults to false.
Tewr.Blazor.FileReader
Returns true if the application is running on WASM.
Tries reading HubOptions.MaximumReceiveMessageSize using reflection.
true
if the value could be sucessfully read.
Name | Type | Description |
---|---|---|
serviceProvider | System.IServiceProvider | |
maximumReceiveMessageSize | System.Int64@ |
Tewr.Blazor.FileReader
Provides extension methods for setting up IFileReaderService
Adds IFileReaderService as a scoped service to the specified IServiceCollection.
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection |
Adds IFileReaderService as a scoped service
to the specified IServiceCollection with the specifed setOptions
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | |
setOptions | System.Action{Tewr.Blazor.FileReader.IFileReaderServiceOptions} | Delegate that modifies the options for IFileReaderService |