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 |
Returns
| Type | Description |
|---|---|
| UploadSource |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|