-
Notifications
You must be signed in to change notification settings - Fork 113
Description
I am using angular2-image-upload library to upload certain files
I recently upgraded from 0.6.6 version to 1.0.0-rc.1 (Because I will be needing some of the new features in the future) Howerver it breaks down every time I try to upload an image (when it used to work ok).
Access to XMLHttpRequest at 'http://192.168.2.103:20005/storage' from origin 'http://192.168.2.103:3007' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
zone.js:2969 Cross-Origin Read Blocking (CORB) blocked cross-origin response http://192.168.2.103:20005/storage with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
HTML Code:
<image-upload [preview]="true" [beforeUpload]="onBeforeUpload" [extensions]="getExtension(field.encodingtype)" [url]="localEnvironment.apiURL + '/storage'" [headers]="imageHeaders" [maxFileSize]="getMaxFileSize(field.MaxSize, field)" [buttonCaption]="'Select Files'" [dropBoxMessage]="'Drop your files here!'"(onFileUploadFinish)="fileSentHandler($event, field,imageHeaders)" "></image-upload>
I handle my CORS restrictions and even have the typical plugin for Allow control origin.
As I said this same call works perfectly fine with previous version.
