Shafiya_Ariff's avatar
0
0
  • Popularity: 0 points
  • Activity: 7 points
  • Pronoun: They/Them/Theirs
  • Joined: 4 years ago
  • Last Login: 4 years ago
  • Profile viewed: 1152 times
  • Has watched: 0 videos
Contact Shafiya_Ariff
  9081 views · 4 years 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...