M
M
miXtik7892022-03-22 18:43:27
ASP.NET
miXtik789, 2022-03-22 18:43:27

Сshtml displays code on the page how to fix it?

here is the code

<!DOCTYPE html>
<html>
<head>
    <link rel="icon" href="https://localhost:44367/favicon">
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>ULIESER</title>
</head>
<body>
    <h2>Выберите файл для загрузки</h2>
    <form action="api/photo.Upload" method="post" enctype="multipart/form-data">
        <input type="text" name="id" /><br>
        <input type="file" name="uploads" /><br>
        <input type="submit" value="Загрузить" />
    </form>
    <br>
    <br>
    <h2>Выберите файл для просмотра</h2>
    <form action="api/photo.GetById" method="post" enctype="multipart/form-data">
        <input type="text" name="id" /><br>
        <input type="submit" value="Загрузить" />
    </form>
    <br>
    <br>
    <h2>Все файлы</h2>
    <br>
    @{
        string[] files = Directory.GetFiles($"{Directory.GetCurrentDirectory()}/uploads");
    }
    @foreach (string file in files)
    {
        <p>@file</p>
        <br>
    }
    
    
</body>
</html>

but why does it end up6239ee9b36bff911041300.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Morrowind, 2022-03-22
@hekkaaa

Apparently he does not understand the partial representation specified by you.
since I don’t know what you have screwed up on the back in the host, I recommend reproducing this simple example shown on metanit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question