Changed the way content of the upload iframe is obtained to innerText/textContent because browsers wrap json/text responses with <pre> tag when using innerHTML.