Hi,
Uploading image not showing on HTML editor. Any reason why not showing the image ? Image is in Image folder but not showing. Please see my controller code below (asp.net core blazor app) . Thanks !
[HttpPost("upload/image")]
public IActionResult Image(IFormFile file)
{
try
{
var extension = "." + file.FileName.Split('.')[file.FileName.Split('.').Length - 1];
var uploadPath = Path.Combine(Directory.GetCurrentDirectory(), "Images/");
var fileName = $"{file.FileName}___{Guid.NewGuid()}{extension}";
var filePath = Path.Combine(uploadPath, fileName);
using (var stream = new FileStream(filePath, FileMode.Create))
{
file.CopyTo(stream);
var url = Url.Content($"~/Images/{fileName}");
return Ok(new { Url = url });
}
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
<RadzenHtmlEditor Style="height: 450px; margin-bottom: 1rem;"
@bind-Value="@Value"
UploadUrl="upload/image"
Disabled="@IsSaving"
Change="@(OnChange)" />