module FileUploadService =
type FileDetails() =
member val fileName= string with get,set
interface IRequiresRequestStream with
member val RequestStream = null with get,set
type FileService() =
inherit Service()
interface IService
member this.Post(request : FileDetails ) =
//My Logic
//can not able to read "request.fileName" property value.
I am trying to create service using servicestack. RequestDTO has two property (fileName and RequestStream
).
I am tring to read value of request.fileName
property and it is showing value ctor@25
. I don't understand why it is showing ctor@25
value every time.
EDIT- Below code is written at Client side.
function uploadBlobOrFile(fileData) {
var xhr = new XMLHttpRequest();
xhr.open('POST', "http://172.27.15.26:8000/ById/FileUploadService", true);
xhr.withCredentials=true;
xhr.onload = function (e) {
progressBar.value = 0;
progressBar.textContent = progressBar.value;
};
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log("success");
}
};
var data = new FormData();
data.append("fileName", "FileName.txt");
data.append("RequestStream", file);
xhr.send(data);
}