• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload_path problem

#1
[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?

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

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

#4
[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?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.