0

i am currently working on a project right now, and the form that i am working on requires user to submit a pdf file. i tried looking for tutorials on how to upload files to a database using laravel, however the tutorials only upload the file names that are uploaded through the form into the database, but the actual files are stored in the public folder of the project. I would like to store the actual files and the file names into the database. any help would be appreciated. thanks in advance!

1 Answers1

0

Follow this tutorial FileSystem in Laravel

This would help you for sure.

Prathamesh Doke
  • 797
  • 2
  • 16
  • 38
  • i've looked at the tutorial but it still stores in the "storage" folder in the project, which is not what i am looking for. i want the PDF file to be stored in the mysql database. – a random programmer Oct 04 '19 at 05:03
  • Why would you want to store files in database? You shouldn't do that. Store path to file instead. – Norbert Jurga Oct 04 '19 at 07:14
  • I agree with @NorbertJurga, you should store the file path instead of a file as it will take more space just to store files, refer this question... https://stackoverflow.com/questions/211895/storing-documents-as-blobs-in-a-database-any-disadvantages – Prathamesh Doke Oct 09 '19 at 04:22