im trying to Send a File[] to a C# API.
In the same POST request i have other value which get received normaly. Whats the best way to Cast/ Receive an File Object? i could retrieve the .stream() or .arrayBuffer() property, but its a promise and is not fullfilled till im sending the Files.
Is there a C# class / Api i could cast the Files[] in?
This is my API
[Route("CreateJobWithFile")]
[HttpPost]
public Task<ApiResultModel<bool>> CreateJobWithFile(testClass test)
{
ApiResultModel<bool> result = new ApiResultModel<bool>()
{
Data = true
};
return Task.FromResult(result);
}
working model
public class testClass
{
public string Verfahren { get; set; }
public string Anwendung { get; set; }
public string Shape{ get; set; }
public string test4 { get; set; }
public List<byte[]> Files { get; set; }
public testClass()
{
Files = new List<byte[]>();
}
}
I tried array of Stream and Byte[] but bot had the Problem that the Promise is not fullfilled