HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Method FromStream

    FromStream(Stream, string, string?)

    Creates a source that reads a seekable stream by setting its position, one read at a time. The content is the whole stream, whose length is read now. A read of a stream whose length has changed since throws an IOException. The stream is not disposed.

    Declaration
    public static UploadSource FromStream(Stream stream, string fileName, string? contentType = null)
    Parameters
    Type Name Description
    Stream stream

    The stream, which must be readable and seekable.

    string fileName

    The name of the file, which the service receives.

    string contentType

    The content type of the file, such as image/png, which the service receives. Default is null, which sends none.

    Returns
    Type Description
    UploadSource
    Exceptions
    Type Condition
    ArgumentException

    stream is not readable or not seekable, or fileName is empty.

    © Singulink. All rights reserved.