Change Audio and Video filenames

I store all assets (images, videos, audio, etc.) in AWS S3.

For images, I implemented (from the SyncFusion samples):

  • <RichTextEditorImageSettings SaveUrl="@(_rteImageSaveUrl)" Path="" />
  • <RichTextEditorEvents OnImageUploadSuccess="@OnImageUploadSuccess" />
The 1st step calls an API Controller which a) creates a unique filename (GUID), b) uploads the stream to S3, and c) adds a header entry to the response with the full S3 path to the image file.
The 2nd step changes the args.File.Name to the new S3 path and filename.
It works perfectly!

I then went to do the same for Audio and Video uploads. RichTextEditorAudioSettings and RichTextEditorVideoSettings both exist and I can set the SaveUrl, but there are no OnAudioUploadSuccess or OnVideoUploadSuccess events. What do you suggest?

Note: I do see FileUploadSuccess, but that doesn't seem right. I also saw OnAudioUploadSuccess in your Angular documentation. Is this something you're maybe planning to add to Blazor soon?

Thanks!

2 Replies

BP Brian Pautsch January 10, 2025 11:31 PM UTC

Disregard. I figured it out.

For audio files:

  • For API Controller: <RichTextEditorAudioSettings SaveUrl="@(_rteAudioSaveUrl)" Path="" />
  • For File name Change: FileUploadSuccess
For video files:
  • For API Controller: <RichTextEditorVideoSettings SaveUrl="@(_rteVideoSaveUrl)" Path="" />
  • For File name Change: FileUploadSuccess
The audio and video uploads both share the  FileUploadSuccess event and run the same code.
I would suggest SF rename FileUploadSuccess to OnFileUploadSuccess for consistency.


BT Bhuvaneshwari Thirunavukarasu Syncfusion Team January 22, 2025 01:07 PM UTC

Hi Brian Pautsch,

Thank you for sharing your observations and suggestions with us.

We appreciate your feedback regarding the naming convention. As per .NET best practices, methods that raise events are typically named using the "On<EventName>" pattern. However, FileUploadSuccess is not an event-raising method, but rather an EventCallback that gets or sets the callback to be executed upon the successful upload of a media file (audio or video). This distinction is intentional to maintain clarity and consistency within the framework.

We will conduct a complete analysis to determine the best approach for maintaining consistency, either by adding the 'On' prefix to events or removing the 'On' prefix from existing events. If we identify any inconsistencies, we will make the necessary updates and refresh our documentation accordingly.

Regards,

Bhuvaneshwari T


Loader.
Up arrow icon