• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Batch Image Upload

I'm using CodeIgniter (1.7) to create the backend for a gallery. For uploads, I want to be able to upload about 10-20 1MB+ photos, resize them, and store there file paths in the database. All of this needs to be done without the server timing out.

I'd greatly appreciate any advice/solutions/tips for doing this -- I'm a bit stumped at the moment!

You need to use the Image Magick library for resizing. It's way more efficiemt than GD.

Furthermore you may need to set higher values for
* upload_max_filesize (so you can upload larger files than the default 2MB, careful with what you set here Smile)
* max_input_time
* memory_limit
* max_execution_time
* post_max_size (so your total post can be bigger than the default 8MB)

You do not need to alter php.ini for this. You can use ini_set().

max_input_time can be set using set_time_limit()

You may also want to look into Swf Upload

It's had a few issues dealing with Flash Player 10 and is not as elegant as it used to be, but it's still a great way to upload multiple files with progress indicators etc.

Quite a learning curve to get it integrated in an application but your users will thank you in the end. It will solve many of your timeout troubles as you're moving a lot of the heavy processing over to Ajax routines.

It does - eventually - integrate into CI nicely but you may have to solve some authentication problems as the Flash Player will initiate a new session when it connects.

That all sounds a bit negative doesn't it?! Didn't mean to. Once it's all working it makes a HUGE difference to your application.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.