I have an input file form in phtml to import data from csv file type like this:
<div class="import-shipping">
<div class="header">
<h4>CSV File:</h4>
</div>
<form class="import-shipping-form" action="<?= $postUrl ?>" method="POST" enctype="multipart/form-data">
<?php echo $block->getBlockHtml('formkey'); ?>
<input type="file" required class="required-entry" name="csv" />
<button type="submit">Import</button>
</form>
</div>
How can i read the validate the the csv file and turn it into an array, and validate the file input asfile type is csv in my controller?
for example my csv file look like this: