Welcome Guest, Not a member yet? Register   Sign In
Error in uplaoding file
#1

[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>&lt;input type='file' name="userfile" id="userfile" &gt;&lt;/td>
                </tr>
</table>
&lt;?php echo form_close();?&gt;
#2

[eluser]adityamenon[/eluser]
So what's the problem? Just use wamp 5.3! It's not affecting your production server right? God!
#3

[eluser]samitrimal[/eluser]
@adityamenon, Yes i know but client want me to run it in the old server so if any one have any solution regarding this issue.Any help will be appreciated
#4

[eluser]InsiteFX[/eluser]
You can try to add the mime type to your .htaccess file!
Code:
AddType application/pdf .pdf

InsiteFX
#5

[eluser]adityamenon[/eluser]
I'm sorry for the offtopic banter, but your client plans to run his production server on Wamp?




Theme © iAndrew 2016 - Forum software by © MyBB