Skip to main content

FileSavingEventArgs.OutputStream Property

Set this property to change the original file content.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web


public Stream OutputStream { get; set; }

Property Value

Type Description

A Stream object to which the modified file stream is sent.


ASPxHtmlEditor allows you to edit (modify, check etc.) a file before saving it to the server. You can obtain an uploaded file using the FileUploadCompleteEventArgs.UploadedFile.FileContent property, perform actions on the stream, and send it to the server by setting the OutputStream property. Note that initially, the OutputStream property value is null.


The file content provided by the OutputStream property shouldn’t be disposed.


The example below demonstrates how you can use the ASPxHtmlEditor.ImageFileSaving server-side event to add a watermark to the uploaded image files.

protected void ASPxHtmlEditor1_FileDownloading(object source, DevExpress.Web.FileSavingEventArgs e) {
    using(Stream fileContent = e.UploadedFile.FileContent)
        e.OutputStream = AddWatermarkToImage(fileContent);        
See Also