Image settings path, server API

Hi

I'm trying to figure out how to get my images from my database, once they have been inserted.

Realistically i need the path to be a route to a controller with the "GUID" that my image has been given as an ID, when it was saved, like this:

<SfRichTextEditor @bind-Value="@BindingValue" Placeholder="@PlaceholderText">
<RichTextEditorToolbarSettings Items="@_tools" Type="ToolbarType.MultiRow"/>
<RichTextEditorFontFamily Default="Arial"></RichTextEditorFontFamily>
<RichTextEditorImageSettings SaveUrl="api/media/saveimage" Path="@($"api/media/{imageId}")"></RichTextEditorImageSettings>
</SfRichTextEditor>

I cannot figure out how to set this imageId in the path, and all your examples points to a folder, which i'm not interrested in.

Can you help me here?




8 Replies 1 reply marked as answer

CA Christian Andersen May 9, 2021 08:40 PM UTC

I did figure it out.

I used the rename example to set the name of my file to the ID that it got from the database.

<SfRichTextEditor @bind-Value="@BindingValue" Placeholder="@PlaceholderText">
<RichTextEditorToolbarSettings Items="@_tools" Type="ToolbarType.MultiRow"/>
<RichTextEditorFontFamily Default="Arial"></RichTextEditorFontFamily>
<RichTextEditorImageSettings SaveUrl="api/media/saveimage" Path="@("api/media/")"></RichTextEditorImageSettings>
<RichTextEditorEvents OnImageUploadSuccess="@(ImageUploadSuccess)"></RichTextEditorEvents>
</SfRichTextEditor>
private void ImageUploadSuccess(ImageSuccessEventArgs imageSuccessEventArgs)
{
var headers = imageSuccessEventArgs.Response.Headers;
var match = Regex.Match(headers, @"[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}");
imageSuccessEventArgs.File.Name = match.Value + ".jpg";
StateHasChanged();
}

Maybe the documentation should state more clearly that the "path" automatically appends the name to whatever you write in there ?





Marked as answer

RK Revanth Krishnan Syncfusion Team May 10, 2021 07:45 AM UTC

Hi Christian, 
 
 
Greetings from Syncfusion support. 
 
 
We are glad that you found the solution for the reported query in our documentation, as suggested we will add more information regarding the ‘Path’ property in our documentation. 
We will let you know once we include the information in the documentation and published on live. 
 
Regards, 
Revanth 



RK Revanth Krishnan Syncfusion Team May 11, 2021 10:11 AM UTC

Hi Christian, 
 
The documentation changes will be included on 1st June 2021. 
 
Regards, 
Revanth 



RK Revanth Krishnan Syncfusion Team June 2, 2021 03:27 PM UTC

Hi Christian,  
  
Sorry for the inconvenience.  
  
The documentation changes are not included, we will include the documentation changes in the 2021 Volume 2 release. 
We appreciate your patience till then.  
  
Regards,  
Revanth 



RK Revanth Krishnan Syncfusion Team July 2, 2021 12:51 PM UTC

Hi Christian,   
   
Sorry for the inconvenience.   
   
Still, the documentation changes are not included, we will include the documentation changes on or before 20th July 2021. 
We appreciate your patience till then.   
   
Regards,   
Revanth  



VJ Vinitha Jeyakumar Syncfusion Team July 20, 2021 02:15 PM UTC

Hi Christian,    
    
Sorry for the inconvenience.    
    
Still, the documentation changes are not included, we will include the documentation changes on or before 3rd August 2021.  
 
We appreciate your patience till then.    
    
Regards,    
Vinitha   



VJ Vinitha Jeyakumar Syncfusion Team August 3, 2021 12:39 PM UTC

Hi Christian, 
 
 
Sorry for the inconvenience 
 
Still, the documentation changes are not included, we will include the documentation changes on or before 24th  August 2021.   
  
We appreciate your patience till then.     
     
Regards,     
Vinitha  



VJ Vinitha Jeyakumar Syncfusion Team August 25, 2021 12:55 PM UTC

Hi Christian,  
 
 
We have included the documentation changes and it also published in live. Please check the below documentation page, 
 
 
Regards, 
Vinitha. 


Loader.
Up arrow icon