1

How to display the 500 internal server error message content in XMLHttpRequest?Below mentioned is working fine for the success message.But when I given if (xhr.status === 500) {},it's just given the "invalidText" response as "Internal Server Error".But not able to get the console message.Kindly help me on this.

var me = this;
var fileInput = this.$.file;
me.formData = new FormData();
me.formData.append('filename', fileInput.files[0], fileInput.files[0].name);
var iframe = me.querySelector('paper-dialog').querySelector('iframe');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(e) {
  if (xhr.readyState === 4 && xhr.status === 200) {
    me.respPrvw = '/neon-ws/preview_' + e.target.response + '/index.html';
    me.set('flgEdit', true);
    me.loadHtml(me.respPrvw);
    iframe.src = me.respPrvw;
  }
};
xhr.open('POST', '/uploadFile', true);
xhr.send(me.formData);
Sankar
  • 15
  • 2
  • 5
  • Already answered here: http://stackoverflow.com/questions/8866761/xmlhttprequest-ajax-error#8866912 – meatFeed Mar 27 '17 at 15:01
  • Possible duplicate of [XMLHttpRequest (Ajax) Error](http://stackoverflow.com/questions/8866761/xmlhttprequest-ajax-error) – pagep Mar 27 '17 at 16:03
  • This is not duplicate, i face the some problem. And no solution yet! – nafsaka Jun 06 '17 at 20:15

0 Answers0