[eluser]samitrimal[/eluser]
I have a error while uploading a pdf file in wamp server 5.2.1 in windows but it works fine in 5.3.x. It shows the userfile empty even when it is not empty in 5.2.1 wampp server.Here is the code.
controller
Code:
if (!empty($_FILES['userfile']['name'])) {
$this->Notice_model->upload_image($id);
}
model
Code:
function upload_image($filename) {
$config = array(
'allowed_types' => 'doc|docx|xls|xlsx|ppt|pptx|jpg|gif|jpeg|png|pdf|txt',
'upload_path' => $this->path,
'max_size' => 6291456,
'file_name' => $filename
);
$this->load->library('upload', $config);
if (!$this->upload->do_upload()) {
$error = $this->upload->display_errors();
die($error);
}
}
View
Code:
<?php echo form_open_multipart ('/notice/');?>
<table>
<tr>
<td>File</td>
<td><input type='file' name="userfile" id="userfile" ></td>
</tr>
</table>
<?php echo form_close();?>