Hello, I'm looking to save an image to the database. I'm using the following:
$config['upload_path'] = './assets/fotos/';
$config['allowed_types'] = '*';
$config['max_size'] = '512000';
$config['max_width'] = '2440';
$config['max_height'] = '1600';
$this->load->library('upload', $config);
$this->upload->initialize($config);
$this->upload->do_upload('arquivo');
$imagem = $this->upload->data();
$file_url = base_url("assets/fotos/{$imagem['file_name']}");
My input is like this:
<div class="form-group col-sm-12">
<label class="col-sm-2">Imagem do Produto:</label>
<input type="file" name="arquivo" id="arquivo" size="99999" class="col-sm-7">
</div>
To save the image, in addition to the insert method in the model I have in the insert method:
"foto" => $file_url
What happens, the photo path is saved (without the file in question of course), for example:
But you are not saving the photo to the informed folder. What am I forgetting? Thank you.