Shafiya_Ariff's Blog

Showing 1 to 1 of 1 blog articles.
  9082 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...