Sree ram
Sree ram

Reputation: 379

Angualr Webapp : Images selected from Android Camera throws CORS error while uploading. The same image upload working fine in Desktop

Developed a Mobile Responsive web application in Angular 8.

There is an image upload functionality which is Working perfectly fine in desktop but facing CORS issue while selecting images from camera. Also the same functionality works when the image is selected from mobile gallery.

Observations

Any inputs / suggestions will help. Thanks in advance

Upvotes: 1

Views: 209

Answers (1)

Sree ram
Sree ram

Reputation: 379

The issue is not related to CORS issue at all. The issue is with the size of the image.

If we try to upload images more than 1 MB then server is throwing 413 error (Request Entity Too Large) which the browser understanding / converting it as CORS error.

So changed the necessary configurations in nginx config file and it started working.

I must admit 2 days in my life got wasted because of this.

Upvotes: 1

Related Questions