Intercepting Large File Uploads |
[eluser]cassy[/eluser]
In my PHP.INI file, I have the following: post_max_size = 21M upload_max_filesize = 20M When I upload a file that’s bigger than 20MB, PHP throws an error and dies! Normal I guess. However, is there a way that I can intercept the error before PHP dies, allowing me to show my own message?
[eluser]marcopolo[/eluser]
Before to call the upload method you can declare the $config for initialize Code: $config['max_size'] = '2048'; // 2Mb Then after calling method for upload you can check for errors and handle it Code: $this->load->library('upload', $config);
[eluser]cassy[/eluser]
Forgive me, I am new to PHP. Where exactly would I put that? I'm also not using CI directly for the upload. I wanted to do an AJAX feedback thing, with a nice progress indicator and so I found the Upload Progress extension for PHP http://blog.liip.ch/archive/tag/uploadprogress/ Could someone tell me more about better integrating the Upload Progress extension with CI?
|
Welcome Guest, Not a member yet? Register Sign In |