[eluser]SPeed_FANat1c[/eluser]
Hi,
I have such file uploading code:
Code:
function do_upload()
{
if($this->membership->is_logged_in())
{
// Image configuration
$config['upload_path'] = './uploads/naujienos/';
$config['allowed_types'] = 'gif|jpg|png';
$config['overwrite'] = FALSE;
$config['file_name'] = 'naujiena.jpg';
$this->load->library('upload', $config);
if(!$this->upload->do_upload())
{
$error = $this->upload->display_errors();
echo $error.':err'; //pagal galune .err javasctriptas atskirs kad cia klaida
}
else
{
$data = $this->upload->data();
if($data['image_width'] > 700)
{
$this->load->model('Image_model','image');
$task = $this->image->image_resize('./uploads/naujienos/'.$data['file_name']);
if($task != 'ok')
{
echo $task.':err'; //pagal galune .err javasctriptas atskirs kad cia klaida
}
else echo $data['file_name'];
}
else echo $data['file_name'];
}
}
else
{
echo 'not_admin';
}
}
And it used to work ok, but now I get an error - "The file name you submit already exists on the server"
This function auto renamed files to naujiena1.jpg, naujiena2.jpg and so on. Now I checked the server there is already naujiena99.jpg. Is this possible that there is a limit of 100 such files? Or there might be something else wrong?
EDIT:
yeah, I now made a fresh function from the userguide to do that, and after it reaches naujiena 99 it shows the same error. Hmm.