So the errors I'm getting when I try to execute the import is "Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR" error.
This is the start of my controller:
namespace Nop.Plugin.Widgets.CustomerImport.Controllers
{
[AutoValidateAntiforgeryToken]
[Area(AreaNames.Admin)]
public class CustomerImportController : BaseAdminController
{
#region Ctor
public CustomerImportController(ICustomerAttributeService customerAttributeService, ICustomerAttributeFormatter customerAttributeFormatter,
ICustomerAttributeParser customerAttributeParser, CustomerSettings customerSettings, IRepository<Customer> customerRepository,
ICustomerService customerService, IEncryptionService encryptionService, IExportManager exportManager,
IWorkContext workContext, IStoreContext storeContext, IMemoryCache cache, INopFileProvider fileProvider, IEmailSender emailSender,
IEmailAccountService emailAccountService, EmailAccountSettings emailAccountSettings,
DateTimeSettings dateTimeSettings,
ForumSettings forumSettings,
GdprSettings gdprSettings,
IAddressAttributeParser addressAttributeParser,
IAddressService addressService,
ICustomerActivityService customerActivityService,
ICustomerModelFactory customerModelFactory,
ICustomerRegistrationService customerRegistrationService,
IDateTimeHelper dateTimeHelper,
IEventPublisher eventPublisher,
IForumService forumService,
IGdprService gdprService,
IGenericAttributeService genericAttributeService,
ILocalizationService localizationService,
INewsLetterSubscriptionService newsLetterSubscriptionService,
INotificationService notificationService,
IPermissionService permissionService,
IQueuedEmailService queuedEmailService,
IRewardPointService rewardPointService,
IStoreService storeService,
ITaxService taxService,
IWorkflowMessageService workflowMessageService,
TaxSettings taxSettings, ICustomerImportManager customerImportManager)
{
_customerAttributeService = customerAttributeService;
_customerAttributeFormatter = customerAttributeFormatter;
_customerAttributeParser = customerAttributeParser;
_customerSettings = customerSettings;
_customerService = customerService;
_customerRepository = customerRepository;
_exportManager = exportManager;
_workContext = workContext;
_encryptionService = encryptionService;
_storeContext = storeContext;
_cache = cache;
_fileProvider = fileProvider;
_emailSender = emailSender;
_emailAccountService = emailAccountService;
_emailAccountSettings = emailAccountSettings;
_gdprSettings = gdprSettings;
_addressAttributeParser = addressAttributeParser;
_addressService = addressService;
_customerAttributeParser = customerAttributeParser;
_customerRegistrationService = customerRegistrationService;
_dateTimeHelper = dateTimeHelper;
_customerImportManager = customerImportManager;
}
#endregion
[HttpPost]
[AuthorizeAdmin]
public async Task<IActionResult> ImportCustomer(IFormFile uploadedFile)
{
if (uploadedFile == null || uploadedFile.Length <= 0)
{
return RedirectToAction("List", "Customer");
}
And this is my widget view:
<button type="button" name="customerimportexcel" class="btn bg-olive" data-toggle="modal" data-target="#customerimportexcel-window">
<i class="fas fa-upload"></i>
@T("Admin.Common.Import")
</button>
@if (Model.HasImportErrors)
{
<img src="@Url.Content("~/Plugins/Widgets.CustomerImport/Content/images/import-error.png")"/>
}
<div id="customerimportexcel-window" class="modal fade import-cart-wrapper" tabindex="-1" role="dialog" aria-labelledby="customerimportexcel-window-title">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customerimportexcel-window-title">@T("Admin.Common.ImportFromExcel")</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form asp-controller="CustomerImport" asp-action="ImportCustomer" method="post" enctype="multipart/form-data">
<div class="form-horizontal">
<div class="modal-body">
<ul class="common-list">
<li>
<em>@T(ResourceNames.ImportTip)</em>
</li>
<li>
<em>@T("Admin.Common.ImportFromExcel.ManyRecordsWarning")</em>
</li>
</ul>
<div class="form-group row">
<div class="col-md-2">
<div class="label-wrapper">
<label class="col-form-label">
@T("Admin.Common.ExcelFile")
</label>
</div>
</div>
<div class="col-md-10">
<input type="file" id="customerimportexcelfile" name="uploadedFile" class="form-control" asp-for="UploadedFile" />
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" name="importcustomer" class="btn btn-primary">
@T("Admin.Common.ImportFromExcel")
</button>
</div>
</div>
</form>
</div>
</div>
</div>