CodeIgniter Forums
upload_path problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: upload_path problem (/showthread.php?tid=43543)



upload_path problem - El Forum - 07-15-2011

[eluser]Unknown[/eluser]
Code:
$config = array(
    'allowed_types' => 'jpg|jpeg|gif|png',
    'upload_path' => './theme/img/produkty/',
    'file_name' => $newName
);
        
$this->load->library('upload', $config);
if(!$this->upload->do_upload('zdjecie')) {
    $error = array('error' => $this->upload->display_errors());
    print_r($error);
}
        
$image_data = $this->upload->data();

print_r($image_data);

that's part of my code. and that's what I get:

Quote:Array ( [error] =>

The upload destination folder does not appear to be writable.
) Array ( [file_name] => 1310725368.jpg [file_type] => [file_path] => /home/majestic/public_html/choco/theme/img/produkty [full_path] => /home/majestic/public_html/choco/theme/img/produkty1310725368.jpg [raw_name] => 1310725368.jpg [orig_name] => [client_name] => [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => )

what bothers me is full_path, which I guess is the reason of my problem - file isn't uploaded

why the last / from upload path disappears? and how can I fix it?


upload_path problem - El Forum - 07-16-2011

[eluser]Eric Barnes[/eluser]
You probably just need to chmod theme/img/produkty/ to 777,


upload_path problem - El Forum - 07-16-2011

[eluser]Unknown[/eluser]
No, that was the first thing I checked.


upload_path problem - El Forum - 07-17-2011

[eluser]vadimyer[/eluser]
meesha, maybe first you should remove exclamation mark from if(!$this->upload->...) and create the case in which the upload function is checked to be working?