How can I insert large files in MySQL db using PHP? -


I want to upload a larger file size of 10 MB in my MySQL database. Using "Code> .htaccess I have changed my file upload limit of PHP to" 10485760 "= 10 MB. I can upload files up to 10 MB without any problem.

But I can not insert the file into the database if it is more in 1 MB size.

I am using file_get_contents to read all the file data and enter it in a single query as a string to put it into a long ball field.

But files larger than 1 MB are not added to the database, although I can ensure that the file is uploaded properly by using print_r ($ _ FILES) Any help will be appreciated and I will need it within the next 6 hours. Therefore, please help!

As far as I know it is usually faster and better practice, because in DB It will be very fast on a large scale and it will slow down the directory to make a way to store the file is best and then store the location of the file in DB.

We work in CMS, as we do for images / PDFs / MPES etc. Creating a folder for the name file with the URL-protected file name and storing the folder name in DB. It's easy to write URLs in the presentation level.


Comments