Changed the way content of the upload iframe is obtained...

...to innerText/textContent because browsers wrap json/text responses with &lt;pre&gt; tag when using innerHTML.