JavaScript Cors request method PUT is not allowed by Access-Control-Allow-Methods cors request method options,cors access-control-request-method,invalid

I'm using Cors requests to communicate between my client and server placed in two different domain.

I configurate my apache http server this way it's using SSL :

//with AJAX withCredentials=true (cookies sent, SSL allowed...)
SetEnvIfNoCase ORIGIN (.*) ORIGIN=$1
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" 
Header always set Access-Control-Allow-Origin "%{ORIGIN}e"
Header always set Access-Control-Allow-Credentials "true"
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]

My ajax request is like this :

$.ajax({   url: URL,
                        type: 'PUT',
                      xhrFields: {
                           withCredentials: true
                        },
                        crossDomain: true,
                        data: userPreferences, 
                        success: function() { }
                    });
$.ajax({   url: URL,
                        type: 'GET',
                      xhrFields: {
                           withCredentials: true
                        },
                        crossDomain: true,                              
                        success: function() { }
                    });

The result of this configuration is, my get request is working but not my put request,i get the following error in google chrome console ( itried it with firefox )

 XMLHttpRequest cannot load https://URL. Method PUT is not allowed by Access-Control-Allow-Methods.

How can i fix this ?

Answer:1

Im using dropzonejs to upload photos to my website. The problem is, when I click dropzone to upload, it won't show 'Gallery' as an option as seen in this image : How to add Gallery as an option?

Im using dropzonejs to upload photos to my website. The problem is, when I click dropzone to upload, it won't show 'Gallery' as an option as seen in this image : How to add Gallery as an option?

  1. upload photo from iphone
  2. upload photo from iphone to pc
  3. upload photo from iphone to icloud
  4. upload photo from phone to pc
  5. upload photo from desktop to instagram
  6. upload photo from computer to iphone
  7. upload photo from pc to instagram
  8. upload photo from iphone to google drive
  9. upload photo from iphone to dropbox
  10. upload photo from pc to icloud
  11. upload photo from computer to instagram
  12. upload photo from iphone to facebook
  13. upload photo from mac to iphone
  14. upload photo from camera roll to snapchat
  15. upload photo from instagram web
  16. upload photo from gallery android studio
  17. upload photo from iphone to laptop
  18. upload photo from mac to instagram
  19. upload photo from phone to laptop
  20. upload photo from mac

I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...

I am trying to implement a chat application using the codeigniter framework but on form submit, the form data does not get submitted and the submit button becomes disabled. when I check on the ...

  1. codeigniter chat application github
  2. codeigniter chat application source code
  3. codeigniter chat application
  4. codeigniter chat application example
  5. codeigniter chat app
  6. php codeigniter chat application
  7. codeigniter realtime chat application with jquery and ajax

Sincere apologies if this has already been covered. I've been trawling StackOverflow for a while now and I cannot find anything that will fix my issue. Many people have this error, but theirs seem to ...

Sincere apologies if this has already been covered. I've been trawling StackOverflow for a while now and I cannot find anything that will fix my issue. Many people have this error, but theirs seem to ...

  1. uncaught referenceerror functionname is not defined

I need to draw a line in the following manner:   For now, it will be only drawn in code, no user input. My question is, how to draw perpendiculars to a line, if I draw it point by point? (Obviously,...

I need to draw a line in the following manner:   For now, it will be only drawn in code, no user input. My question is, how to draw perpendiculars to a line, if I draw it point by point? (Obviously,...

  1. drawing line with bearing and distance autocad
  2. drawing line with angle autocad
  3. drawing line with coordinates in autocad
  4. drawing line with arrow
  5. drawing with line
  6. line drawing with color
  7. lined paper drawing
  8. line drawing with shading
  9. line drawing with photoshop
  10. line drawing with pen
  11. line drawing with gimp
  12. line drawing with illustrator
  13. drawing with line of action
  14. line drawing with dda
  15. line drawing with mouse
  16. line drawing with hand
  17. drawing with line tool
  18. drawing a line with css
  19. drawing a line with a chicken
  20. drawing a line with a compass