using Microsoft.Extensions.FileProviders; paketini projemize ekliyoruz.

sonra program.cs dosyasına app.UseStaticFiles(); ‘ın altına

StaticFileOptions staticFileOptions = new()
{
FileProvider = new PhysicalFileProvider(Path.Combine
(app.Environment.ContentRootPath, "Yonetim")),
RequestPath = "/Yonetim"
};

app.UseStaticFiles(staticFileOptions);

kodunu yazdım. bu kot aracılığı ile Yonetim diye bir dosya açıp o klasöre dosya atıp cshtml dosyasındaki a , img vb. kodlarındaki src href gibi attribute ler ile bu dosyamızdaki resim pdf img gibi şeyleri çağıya biliriz.

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir