0

i am Trying to upload image to some External URL. I am getting Cross-Origin Request Blocked in the console. My response contains complete JSON data.

I have got a form with enctype="multipart/form-data". And this is my ajax

 $.ajax({
    url: 'externalURL/image/upload'
    type: 'POST',                               
    cache: false,
    processData:false,
    crossDomain: true,                                                          
    dataType : 'jsonp', 
    jsonpCallback: 'jsonCallback',
    data: $("#multiform").serialize(),  
    beforeSend: function (xhr)
    { 
        xhr.setRequestHeader("Content-Type","application/json");
        xhr.setRequestHeader("Accept","text/json");
    },
    error: function (xhr, status) {
        alert(status);
    },
    success: function (result) {
        alert(result);  
    }
}); 

I am getting error alert , when i try to upload.

Matarishvan
  • 2,382
  • 3
  • 38
  • 68
  • This might help: http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work – Adrian Forsius Oct 15 '14 at 06:57
  • IE Cross origin request is not allowed by default and has to be turned on at the server alternativly there is solutions like JSONP but these workarounds is very limited and troublesome. – Adrian Forsius Oct 15 '14 at 07:06

0 Answers0