title: .NET Core API - Return Image URL from Server and not from local storage
body: <p>In Chrome i get following error:</p>
  <pre><code>Not allowed to load local resource: C://...
  </code></pre>
  <p>Now i want to change the return from the Image in like 'localhost:44346/wwwroot/images/profileimages/img.jpg'</p>
  <p>Can you tell my how i can do this?</p>
  <p>This is my Controller for the Fileupload:</p>
  <pre><code>    [HttpPut]
      [Authorize]
      [RequestSizeLimit(1_000_000)]
      [Route(&quot;UpdateImage&quot;)]
      public async Task&lt;IActionResult&gt; UpdateImage([FromForm]ApplicationUserModel model)
      {
          try
          {
              var user = await _userManager.FindByIdAsync(model.id);
              if (user.ProfileImagePath != null)
              {
                  var file = new FileInfo(user.ProfileImagePath);
                  file.Delete();
              }
              var uniqueFileName = GetUniqueFileName(model.ProfileImage.FileName);
              var uploads = Path.Combine(hostingEnvironment.WebRootPath, &quot;Images\\ProfileImages&quot;);
              var filePath = Path.Combine(uploads, uniqueFileName);
              await model.ProfileImage.CopyToAsync(new FileStream(filePath, FileMode.Create));
              user.ProfileImagePath = filePath;
  
              var result = await _userManager.UpdateAsync(user);
  
              return Ok(result);
  
          }
          catch (Exception ex)
          {
  
              throw ex;
          }
      }
  </code></pre>
  <p>This is the Controller for getting the User Informations:</p>
  <pre><code>[HttpGet]
  [Authorize]
  [Route(&quot;GetCurrentUser&quot;)]
  public async Task&lt;IActionResult&gt; GetCurrentUser()
  {
      try
      {
          var userId = User.FindFirst(&quot;UserID&quot;)?.Value;
          var data = await _userManager.FindByIdAsync(userId);
  
          var user = new UserStandardModel
          {
              id = userId,
              LastName = data.LastName,
              FirstName = data.FirstName,
              ProfileImagePath = data.ProfileImagePath
          };
  
  
          return Ok(user);
      }
      catch (Exception ex)
      {
  
          throw ex;
      }
  }
  </code></pre>