Welcome Guest, Not a member yet? Register   Sign In
The upload path does not appear to be valid.
#1

[eluser]behnampmdg3[/eluser]
Hi;

What s wrong with this?

Directory structure:

images folder is in the root where index.php exists (one above application).
Code:
public function upload()
  {
   $config['upload_path'] = base_url('images/');
   $config['allowed_types'] = 'jpg';
   $config['max_width']  = '700';
   $config['max_height']  = '214';

   $this->load->library('upload', $config);

   if ( ! $this->upload->do_upload())
    {
     $error = array('error' => $this->upload->display_errors());
  
     $this->load->view('edit_photo', $error);
    }
   else
    {
     $data = array('upload_data' => $this->upload->data());
  
     $this->load->view('edit_photo', $data);
    }
  }

Thanks
#2

[eluser]PravinS[/eluser]
the $config['upload_path'] should be absolute or relative path, where as base_url('images/') is base http URL of a site
#3

[eluser]behnampmdg3[/eluser]
[quote author="PravinS" date="1372764866"]the $config['upload_path'] should be absolute or relative path, where as base_url('images/') is base http URL of a site[/quote]What do you mean? What shoud I change in my code?

It started working anyways!!!!

But I get this after it uploads successfully:
Quote:A PHP Error was encountered

Severity: Warning

Message: finfo_open(): Failed to load magic database at ''.

Filename: libraries/Upload.php

Line Number: 1035




Theme © iAndrew 2016 - Forum software by © MyBB