i'm usin asp core 2.2
[HttpPost]
[Route("Create")]
public IActionResult Create([FromForm]SubjectWebFullDto newWeb)
{
try
{
if (!ModelState.IsValid)
return BadRequest(new BadRequestError("Incorrect Model"));
if (string.IsNullOrEmpty(newWeb.SourceWeb))
return NotFound(new NotFoundError("Incorrect Model"));
var subject = _subjectService.Get(newWeb.SubjectId);
var newObj = newWeb.LoadFrom(subject.Guid);
_subjectWebService.Insert(newObj);
return Ok();
}
catch (System.Exception ex)
{
}
}
every thing without upload image on local and server are fine. when upload image in local reponse OK: Local Api Post Man
but in server iis failed: Server Api Post Man
i'm using server iis 7 what's problem of uploading image in server?
Model:
public class SubjectWebFullDto
{
public int WebId { get; set; }
public string ImageUrl { get; set; }
public IFormFile Image { get; set; }
[MaxLength(200)]
public string Name { get; set; }
[MaxLength(10)]
public string PublishDate { get; set; }
[MaxLength(1000)]
[Required]
public string SourceWeb { get; set; }
[MaxLength(300)]
[Required]
public string Lead { get; set; }
public string Body { get; set; }
[MaxLength(300)]
public string Descript { get; set; }
public int SubjectId { get; set; }
}