S
S
Sergey2018-03-01 22:40:58
Web development
Sergey, 2018-03-01 22:40:58

How to add pictures in laravel?

Not strong in laravel, so such a question?)
I copied the view from another file
There is a view

<script>
$(function () {
        $("#uploadBtn").change(function () {
            $('#fn').html($('#uploadBtn').val());
        });
    });

    $(document).on('click', '.sub-data', function () {
        var dis = document.getElementById('upload_for');
        var uploadBtn = document.getElementById('uploadBtn');
        var msg = document.getElementById('msg');

        if (dis.value == "") {
            msg.innerHTML = "Please Select Employee for Display.";
            dis.focus();
        } else if (uploadBtn.value == "") {
            msg.innerHTML = "Please Select File for Upload.";
            uploadBtn.focus();
        } else {
            msg.innerHTML = "";
            document.frmAddFile.submit();

        }
    });
</script>
<td>
      <div class="fileUpload btn btn-success" style="width: 130px; margin-left: 1px;">
            <span>Upload File</span>
            <input id="uploadBtn" type="file" value="" required="true" name="custImage" class="upload"/>
      </div>
</td>
<button type="button" class="btn btn-outline sub-data">Save changes</button>

Tell me where to look? What models are created and controllers? Where to change something so that everything works, the file was added and the image data in the database

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question