I am facing an issue with retrieving a file from dxFileUploader (DevExpress) and not being able to read it in the code behind. The file is only appearing as an object. Here is My FileUploader :
{
location: "before",
widget: "dxFileUploader",
options: {
multiple: false,
accept: "*",
value: [],
uploadMode: "instantly",
onValueChanged: (e) => {
$.ajax({
url: "api/CoordinateSystems/UploadFile",
type: "POST",
data: e.value,
error(xhr, textStatus, errorThrown) {
DxExtensions.notifyAjaxError(xhr, textStatus, errorThrown);
DxExtensions.error(errorThrown);
},
success(data) {
dataSource.load();
}
});
}
}
Codebehind:
[HttpPost]
[Route("UploadFile")]
public IActionResult UploadFile(dynamic file)
{
List<string> errors = new List<string>(); // added this just to return something
if (file != null)
{
string physicalWebRootPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "wwwroot");
// do something
}
return Ok();
}
Could someone provide guidance on how to properly retrieve a file from dxFileUploader, save it on the server, and work with it?