Welcome Guest, Not a member yet? Register   Sign In
problem in uploading msword document
#1

[eluser]mrcoder[/eluser]
Hi,

Iam trying to upload a msword doc file.when iam uploading a doc file iam getting the errot asArray ( [error] =>

You did not select a file to upload.
)


and my code is

Code:
$config['upload_path'] = 'uploads';
        $config['allowed_types'] ='application/msword | application/vnd.ms-word';
        // loading the upload class
        $this->load->library('upload', $config);
        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            print_r($error);
        }
can any one help me.
#2

[eluser]umefarooq[/eluser]
hi try this hope it will work
Code:
$config['allowed_types'] = 'doc|docx';
#3

[eluser]mrcoder[/eluser]
still iam getting the same problem Sad
#4

[eluser]pistolPete[/eluser]
Try modifying mimes.php like this:
Code:
'doc'    =>    array('application/msword','application/vnd.ms-word')

In your controller:
Code:
$config['allowed_types'] = 'doc'

If that doesn't work, post the result of print_r($_FILES) here.
#5

[eluser]mrcoder[/eluser]
still getting the error msg inthe browser as
Code:
Array ( [error] =>

You did not select a file to upload.
)
#6

[eluser]pistolPete[/eluser]
[quote author="pistolPete" date="1255971049"]If that doesn't work, post the result of print_r($_FILES) here.[/quote]

Also check if the file you are uploading does not exceed these php.ini settings:

- upload_max_filesize
- post_max_size
#7

[eluser]mrcoder[/eluser]
Code:
Array ( [resumeupload] => Array ( [name] => Naveen.doc [type] => application/msword [tmp_name] => D:\wamp\tmp\php1BF.tmp [error] => 0 [size] => 70144 ) )
#8

[eluser]umefarooq[/eluser]
have you put in your form open tag enctype

Code:
enctype="multipart/form-data"
#9

[eluser]umefarooq[/eluser]
pass your field name in do_uplaod function
Code:
$this->upload->do_upload('resumeupload')
#10

[eluser]mrcoder[/eluser]
thank u its working fine now.




Theme © iAndrew 2016 - Forum software by © MyBB