Hi I'm very new to stackoverflow and codeigniter so I apologize if I'm breaking any rules or etiquette with this question (I did a search of the related questions and didn't see anything that related directly to my question).
I'm trying to upload a PDF file, and I'm using the following code (codeigniter version 1.7.2):
function test(){
$this->load->library('upload');
$config['upload_path'] = './assets/certificates/';
$config['allowed_types'] = 'pdf';
$config['max_size'] = '1000000';
$config['file_name'] = "test";
$this->upload->initialize($config);
$certificateflag = $this->upload->do_upload("certificate");
if ($this->upload->do_upload("certificate"))
error_reporting(E_ALL);
else{
echo "<pre>"; Print_r($this->upload->data()); echo "</pre>";
}
}
I don't get any errors, and it appears that the file gets uploaded, but it doesn't appear in the directory, and I can't find it anywhere on the server. The output from the above gives me the path of where the file should be,but it's not there.
I'm using almost the exact block of code in another part for jpg files that I upload to the same directory and that works fine.
Any help/ideas are greatly appreciated.