mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
Serve uploaded images as static assets.
This commit is contained in:
@@ -46,7 +46,7 @@ namespace RadzenBlazorDemos
|
||||
file.CopyTo(stream);
|
||||
|
||||
// Return the URL of the file
|
||||
var url = Url.Content($"~/{fileName}");
|
||||
var url = Url.Content($"~/images/{fileName}");
|
||||
|
||||
return Ok(new { Url = url });
|
||||
}
|
||||
|
||||
@@ -115,7 +115,14 @@ if (!app.Environment.IsDevelopment())
|
||||
Path.Combine(app.Environment.WebRootPath, "demos")),
|
||||
RequestPath = "/demos"
|
||||
});
|
||||
|
||||
app.UseStaticFiles(new StaticFileOptions {
|
||||
FileProvider = new PhysicalFileProvider(
|
||||
Path.Combine(app.Environment.WebRootPath)),
|
||||
RequestPath = "/images"
|
||||
});
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
app.UseAntiforgery();
|
||||
app.MapGet("/llms.txt", () =>
|
||||
|
||||
Reference in New Issue
Block a user