ng2-file-upload icon indicating copy to clipboard operation
ng2-file-upload copied to clipboard

Change Method

Open fzunigad opened this issue 7 years ago • 4 comments

this uploader = new FileUploader({ url: URL, method: "POST", headers: [ { name: "Content-Type", value: "multipart/form-data" }, { name: "Authorization", value: "Bearer " + user.accessToken } ] });

After doing this it doesn't change the Method it just sends as "OPTIONS" and I need "POST"

fzunigad avatar Jan 26 '18 15:01 fzunigad

Hi! I'm having the same issue, were you able to figure it out?

elizabethfernandez avatar Jun 28 '18 14:06 elizabethfernandez

Yup, at the end it was a CORS problem. It sends an OPTIONS but after that it sends the POST. so if you haven't set CORS headers on your server it will fail right after the OPTIONS call.

fzunigad avatar Jun 28 '18 15:06 fzunigad

Thanks! I'm kind of new to this and I'm not familiar with CORS, can you share your solution? I have a Spring boot back-end application

elizabethfernandez avatar Jun 28 '18 16:06 elizabethfernandez

Running into the same issue. POST becomes a GET. No CORS for me

kojilab avatar Feb 17 '20 20:02 kojilab