0
Hello, I am wanting to save an image in the database. I am 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']}");
Already 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, is saved the path of the photo (without the file in question of course), for example:
http://[::1]/Nameapp/Assets/photos/
But you’re not saving the photo in the briefcase. What am I forgetting? Thank you.
Are you sure the directory in question is writable?
– rpereira15