IBrowserFile Interface


Represents the data of a file selected from an InputFile component.

Note: Metadata is provided by the client and is untrusted.

public interface class IBrowserFile
public interface IBrowserFile
type IBrowserFile = interface
Public Interface IBrowserFile



Gets the MIME type of the file as specified by the browser.


Gets the last modified date as specified by the browser.


Gets the name of the file as specified by the browser.


Gets the size of the file in bytes as specified by the browser.


OpenReadStream(Int64, CancellationToken)

Opens the stream for reading the uploaded file.

Extension Methods

RequestImageFileAsync(IBrowserFile, String, Int32, Int32)

Attempts to convert the current image file to a new one of the specified file type and maximum file dimensions.

Caution: there is no guarantee that the file will be converted, or will even be a valid image file at all, either before or after conversion. The conversion is requested within the browser before it is transferred to .NET code, so the resulting data should be treated as untrusted.

Applies to