I used this below function for geting file from url with XMLHttpRequest:
XMLHttpRequest
function loadFile(filePath) { var result = null; var xmlhttp = new X