BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[index.html]
@{
var asyncSettings = new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "https://localhost:44342/Home/Save", RemoveUrl = "https://localhost:44342/Home/Remove" };
}
@using Syncfusion.EJ2
<div class="col-lg-12 control-section" id="target">
<ejs-uploader id="uploadFiles" asyncSettings="@asyncSettings" autoUpload="false" uploading="onFileUpload"></ejs-uploader>
</div>
<script>
function onFileUpload(args) {
args.customFormData = [{ 'name': 'Syncfusion INC' }];
}
</script>
[controller]
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
[AcceptVerbs("Post")]
public IActionResult Save(IFormCollection form)
{
string valueFromClient = Request.Form["name"];
foreach (var file in form)
{
Console.WriteLine(file);
}
try
{
foreach (var file in form)
{
if (form != null)
{
}
}
}
catch (Exception e)
{
Response.Clear();
Response.ContentType = "application/json; charset=utf-8";
Response.StatusCode = 204;
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "No Content";
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = e.Message;
}
return Content("");
} |