How can i insert large files in mysql db using php?

Posted by anjan on Stack Overflow See other posts from Stack Overflow or by anjan
Published on 2009-01-29T17:16:26Z Indexed on 2010/03/14 20:05 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

Hi!

I want to upload a large file of size 10M max to my mysql database. Using .htaccess i changed the PHP's own file upload limit to "10485760" = 10M, i am able to upload files upto 10M size without any problem.

But i can not insert the file in database if it is more that 1M in size.

i am using file_get_contents to read all file data and pass it to the insert query as a string to be inserted into a LONGBLOB field.

But files with more than 1M size is not being added to database, though i can use print_r($_FILES) to examine that the file uploaded correctly. Any help will be appreciated and i will need it within next 6 hours. So, please help!

best regards, Anjan

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql