Getting MIME type ‘application/octet-stream’ after Uploading a csv file?

  laravel, php

When i try to upload a csvfile its MIME type changes to application/octet-stream. Although i specified enctype="multipart/form-data" in the form, how can i fix that?

<div class="container mt-5">
        <form action="{{route('fileUpload')}}" method="POST" enctype="multipart/form-data">
            <h3 class="text-center mb-5">Download file</h3>
            @if ($message = Session::get('success'))
                <div class="alert alert-success">
                    <strong>{{ $message }}</strong>

            @if (count($errors) > 0)
                <div class="alert alert-danger">
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>

            <div class="custom-file">
                <input type="file" name="file" class="custom-file-input" id="chooseFile">
                <label class="custom-file-label" for="chooseFile">Choose file</label>

            <button type="submit" name="submit" class="btn btn-primary btn-block mt-4">

Source: Laravel

Leave a Reply