IRemoteStreamContent may be a parameter or in the DTO of the parameter. It can only be the return type.
Task<IRemoteStreamContent> GetFileAsync(); A blob stream will be returned.
Task UploadFileAsync(IRemoteStreamContent file);
var formdata = new FormData();
formdata.append("file", fileInput.files[0], "logo.png");
var requestOptions = {
method: 'POST',
body: formdata
};
Task UploadFileAsync(UploadFileDto input);
fetch("https://localhost:44328/UploadFileAsync", requestOptions)
var formdata = new FormData();
formdata.append("input.FileName ", "logo.png");
formdata.append("input.FileContent ", fileInput.files[0], "logo.png");
var requestOptions = {
method: 'POST',
body: formdata
};
fetch("https://localhost:44328/UploadFileAsync", requestOptions)
public interface IFileAppService : IApplicationService
{
Task<IRemoteStreamContent> GetFileAsync();
Task UploadFileAsync(IRemoteStreamContent file);
Task UploadFileAsync(UploadFileDto input);
Task UploadFilesAsync(UploadFilesDto input);
Task UploadFile2Async(UploadFile2Dto input);
}
public class UploadFileDto
{
public string FileName { get; set; }
public IRemoteStreamContent FileContent { get; set; }
}
public class UploadFilesDto
{
//Or List<IRemoteStreamContent>
public IEnumerable<IRemoteStreamContent> Files { get; set; }
}
public class UploadFile2Dto
{
public UploadFileChild2Dto Child { get; set; }
}
public class UploadFileChild2Dto
{
//Or IEnumerable<IRemoteStreamContent>
public IRemoteStreamContent FileContent { get; set; }
}
IRemoteStreamContentmay be a parameter or in the DTO of the parameter. It can only be the return type.Task<IRemoteStreamContent> GetFileAsync();A blob stream will be returned.