BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[app.component.html]
<button id='btn' (click)="getFiles()">getFiles</button>
[app.component.ts]
getFiles() {
$.ajax({
type: "POST",
url: 'http://localhost:61046/Home/GetFilesDetails',
success: function (data) {
for (let i: number = 0; i < data.length; i++) {
let filesData = data[i].split('\\');
let length = filesData.length
console.log(filesData[length - 1]);
}
return data;
},
error: function () {
alert('Error occured');
}
});
}
[controller]
[AcceptVerbs("Post")]
public string[] GetFilesDetails()
{
string path = hostingEnv.WebRootPath; // your saved files local path
return Directory.GetFiles(path);
} |