April 20, 2012

Internal server error when uploading large files in php

Question by Kyokasuigetsu

I’m using codeIgniter and I’m getting internal server error when trying to upload large files (might be 1Mb and up)
The file upload script is working because it uploads to the folder in the server. But saving the file into the database it doesn’t work anymore. I’ve already tried changing the following but still doesn’t work:

php.ini

  • post_max_size = 50M
  • upload_max_filesize = 20M

my.ini

  • max_allowed_packet = 2048M
  • max_execution_time = 150

Where else do I have to check to ensure that the file upload to the database works.

Answer by Starx

Save the files do the directory, not on the database. You might want to save the path though in the databse.

If you want to know WHY, here are some previous post you should check.

  1. Storing Documents as Blobs in a Database – Any disadvantages?
  2. Storing Images in DB – Yea or Nay?

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!