danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

CORS request : ERR_CONNECTION_REFUSED #2060

Closed ghasemikasra39 closed 6 years ago

ghasemikasra39 commented 6 years ago

I've read https://github.com/danialfarid/ng-file-upload/issues/188. I had the same problem and I fixed it by using cors node module (https://www.npmjs.com/package/cors) on the server like this : app.use(cors({ origin: true, credentials: true }));

but all request (PUT, POST, ...) cause this error: OPTIONS http://(my ip to the server):3000/... net::ERR_CONNECTION_REFUSED

Notice that this issue is different from the one I mentioned above (issue 188)