I have a text file which is located in a particular folder nn the server. The folder location is stored in the web.config.
I am able to get the value of the folder location in jquery but I am able to read the txt file:
Below is my code:
var baseUrl = window.location.origin;
var fileName = baseUrl + "/" + fileLocation.split("/").pop() + "/" + evt.currentTarget.id;
jQuery.get(fileName, function (data) {
$("#pdfviewerJs").html(data.replace('n', ''));
});
The evt.currentTarget.id is the name of the file and the pdfviewerJs is just a div to display content of text file. Somehow this is not working. The fileName is as below:
http://localhost:58003//D://ViewerTest//test_1240560034094.txt
Any help pls..? I just need to get the file and display the content of the txt.