HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/TDijk1/erp-apps.eu/wwwroot/CMSModules/EventLog/GetEventDetail.aspx.cs
using System;
using System.Text;
using System.Web;

using CMS.EventLog;
using CMS.Helpers;
using CMS.UIControls;

public partial class CMSModules_EventLog_GetEventDetail : CMSEventLogPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int eventId = QueryHelper.GetInteger("eventid", 0);
        EventLogInfo ev = EventLogProvider.GetEventLogInfo(eventId);
        // Set edited object
        EditedObject = ev;

        if (ev != null)
        {
            UTF8Encoding enc = new UTF8Encoding();
            string text = HTMLHelper.StripTags(HttpUtility.HtmlDecode(EventLogHelper.GetEventText(ev)));
            byte[] file = enc.GetBytes(text);

            Response.AddHeader("Content-disposition", "attachment; filename=eventdetails.txt");
            Response.ContentType = "text/plain";
            Response.BinaryWrite(file);

            RequestHelper.EndResponse();
        }
    }
}