|
|
|
@ -14,21 +14,17 @@ namespace Volo.Abp.Content |
|
|
|
|
|
|
|
public virtual long? ContentLength { get; } |
|
|
|
|
|
|
|
public RemoteStreamContent(Stream stream, bool disposeStream = true) |
|
|
|
public RemoteStreamContent(Stream stream, string fileName = null, string contentType = null, long? readOnlyLength = null, bool disposeStream = true) |
|
|
|
{ |
|
|
|
_stream = stream; |
|
|
|
_disposeStream = disposeStream; |
|
|
|
} |
|
|
|
|
|
|
|
public RemoteStreamContent(Stream stream, string fileName = null, string contentType = null, long? readOnlyLength = null, bool disposeStream = true) |
|
|
|
: this(stream, disposeStream) |
|
|
|
{ |
|
|
|
FileName = fileName; |
|
|
|
if (contentType != null) |
|
|
|
{ |
|
|
|
ContentType = contentType; |
|
|
|
} |
|
|
|
ContentLength = readOnlyLength ?? (_stream.CanSeek ? _stream.Length - _stream.Position : null); |
|
|
|
_disposeStream = disposeStream; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual Stream GetStream() |
|
|
|
|