This is my front-end code. THis is small form with one input
for file upload.
<form class="" method="POST" action="<?php echo base_url();?>adminpanel/upload" enctype="multipart/form-data">
<input type="file" name="file">
<div class="widget-footer">
<button class="btn btn-primary" type="submit">Save</button>
</div>
</form>
When I hit the Save button, the following PHP script is executed:
function upload()
{
ini_set('upload_max_filesize', '10M');
ini_set('post_max_size', '10M');
if (!empty($_FILES))
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '2000';
$this->load->library('upload', $config);
if ($this->upload->do_upload())
{ //success
$data = array('upload_data' => $this->upload->data());
}
}
redirect("/home");
}
But instead of successful file upload, I get following message:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log
When I go to the Apache log, there is following error:
[Mon Nov 25 15:57:08 2013] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
What is happening here?