I'm using https://quilljs.com/ text editor for my project on Blazor Server App. I need this for article page.
For now, I can save the text (in the content) into SQl database and the text also can be read from database when I opened on specific article Id.
But now how can I save images that has been inserted in the text editor (in the content) in SQL database or server folder directory?? Multiple images should be stored in this content page and also the database. Anyone here familiar with Blazor?? I've been stuck on this matter for days to solve this issue.
I also have been trying using InputFile component to add multiple upload function, but still the image cannot be save properly in project folder directory.
Update: Below is my code on how to capture the text into Sql database.
private MarkupString preview;
protected async override Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender) return;
bool loading = true;
while (loading)
{
try
{
if (!string.IsNullOrEmpty(monthlySharing.Content))
{
await QuillHtml.LoadHTMLContent(monthlySharing.Content);
}
loading = false;
}
catch
{
await Task.Delay(10);
loading = true;
}
}
}
private async Task Save()
{
message = "wait...";
monthlySharing.Content = await QuillHtml.GetText();
if (monthlySharingService.AddUpdate(monthlySharing))
{
message = "Your post is successfully created! ";
monthlySharing = new();
}
else
{
message = "Could not saved";
}
}
```