[eluser]popovich[/eluser]
Hi,
I am trying to upload a
.php file using the upload class.
Here is a part of the code
Code:
if( isset($_FILES['layoutfile']) ){
$config['upload_path'] = './system/application/views/layouts/';
$config['allowed_types'] = 'php|application/octet-stream';
$config['overwrite'] = true;
$this->upload->initialize($config);
if ( ! $this->upload->do_upload('layoutfile') ){
print_r($_FILES['layoutfile']['type']);
exit($this->upload->display_errors());
} else {
$layfiledata = $this->upload->data();
$filepath = "layout_filepath = '".$layfiledata['file_name']."',";
}
}
Nothing before this piece of code or after it does anything to $_FILES array.
The screen I get looks like this:
Code:
application/octet-stream
The filetype you are attempting to upload is not allowed.
Apparently, the upload class cannot upload the file because of its mime-type?
The form in the view file has
Code:
enctype="multipart/form-data"
in it.
Where is the trouble?...