Reputation: 40
I am new to Laravel 6 and have made a simple blog website, however i am very confused on to how i can add an image directly to the MySQL database. I don't accept user input on my site so i want to post the images directly to the database. Please guide me on how to achieve this. Thanks in advance!
Upvotes: 0
Views: 65
Reputation: 317
While it is possible to store files directly in the database for example by converting them to base64 strings, that's definitely not good practice.
I suggest reading Laravel's docs on files https://laravel.com/docs/7.x/filesystem to see how you can use files stored on the file system for your project.
I am confused by your need for a database if you're not accepting any input, but that's probably another thing.
Upvotes: 1