title: Image in ASP.NET MVC
body: <p>I have form for upload file and i want to upload thumbnail for the file in the same form I am doing that with this part of code :</p>
  <pre><code>var basePath2 = Path.Combine(Directory.GetCurrentDirectory() + &quot;\\Thumbnails\\&quot;);
  bool basePathExists2 = System.IO.Directory.Exists(basePath2);
  
  if (!basePathExists2) 
       Directory.CreateDirectory(basePath2);
  
  var thumbnailPath = Path.Combine(basePath2, Thumbnail.FileName);
  
  if (!System.IO.File.Exists(thumbnailPath))
  {
      using (var stream = new FileStream(thumbnailPath, FileMode.Create))
      {
          await Thumbnail.CopyToAsync(stream);
      }
  }
  </code></pre>
  <p>I am saving this model to the database:</p>
  <pre><code>var fileModel = new FileUploadViewModel
                      {
                          Year = createdOn,
                          PublishedOn = model.PublishedOn,
                          FileType = File.ContentType,
                          Extension = extension,
                          Name = model.Name,
                          Description = model.Description,
                          FilePath = filePath,
                          Author = model.Author,
                          ThumbnailPath = thumbnailPath,
                      };
  </code></pre>
  <p>When I want to show the thumbnail in a view, it doesn't work but in <code>src</code> I have the right path, as you can see in this screenshot:</p>
  <p><a href="https://i.stack.imgur.com/GI43W.png" rel="nofollow noreferrer">Screenshot with Source of image </a></p>