hansa
hansa

Reputation: 139

Ajax call to get remote file only returns part of file

I have an ajax call to get a remote file on my server. It works, but only returns part of the file:

var remoteFile;
$.ajax({  
            async: false,
            url: "http;//myAWSDNS.com/some/path/file.txt",  
            dataType: "text",  
            success: function(data) { 
            remoteFile = data; 
            }  
            });
      .
      .
      .
      //more code

I have confirmed that the file currently looks like this:

user,   wants to pair with

user1, [email protected]
user2, [email protected]

however, in code, remoteFile only is this:

user,   wants to pair with

user1, [email protected]

i.e. it is missing the last line. Why can this be happening? Is it a JavaScript string issue, or an ajax issue?

Thanks,

best regards,

Chris

Upvotes: 0

Views: 71

Answers (2)

Nav
Nav

Reputation: 86

Actually how we're u checking the response? Where writing it to the screen or an alert?

Upvotes: 0

Nav
Nav

Reputation: 86

Try changing datatype to text/plain

Upvotes: 1

Related Questions