I want to upload photos to ASP.NET Web API but return error from some photos uploading. I successfully upload to file size 17002 and smaller but I don't upload file size 17345 and bigger. Note: EnableCors on Web API and maxRequestLength="307200" and maxAllowedContentLength="314572800" all of OK. Error (For example when I tried to upload to a photo file size 17345):
XMLHttpRequest cannot load http://localhost:42658/api/MyApi/UploadFile. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 500.
I'm using IIS7. Anyone have a solution for this?