Shafiya_Ariff's avatar
0
0
  • Popularity: 0 points
  • Activity: 7 points
  • Pronoun: She/Her/Hers
  • Joined: 2 months ago
  • Last Login: 2 months ago
  • Profile viewed: 31 times
  • Has watched: 0 videos
Contact Shafiya_Ariff
  122 views · 2 weeks ago

![](https:/ /cdn.filestackcontent.com/4ckWyda6QQuqMtAFixUR)

Recently I was faced with a task to post data from a .csv file to an external REST API. I’m just going to log in to this article about what I did to get the job done.

Let’s start by creating a template for uploading the file. For this article’s sake, lets make the changes in the dashboard.blade.php file.

```

<form method="post" enctype="multipart/form-data"> @csrf <div class="custom-file"> <input type="file" accept=".csv" name="excel" class="custom-file-input" id="customFile" /> <label class="custom-file-label" for="customFile">Choose file</label > </div> <div> <button type="submit" class="btn btn-primary btn-sm" style="margin-top: 10px" >Submit> </div>

</form>

```

**Note** : Don’t forget to add enctype=”multipart/form-data”!

![](https:/ /cdn.files...