Hello Everyone!

I am unable to upload fiels using Code Igniter framework.
I have one form with the help of it need to upload 4 images in fabrics folder each time.
Before uploading images I need to create folder sructure also but unable to do so by giving absolute path like
mkdir(ADMIN_DATA."uploaded/shirt/parts/".$fabric_type, 0777).
Was able to create folder with the path like
mkdir("C:/xampp/htdocs/project/admin_data/uploaded/shirt/parts/".$fabric_type, 0777)
Also images was going correctly while adding on local system.

I want to do it on test server instead on local system so I did changes of mkdir(ADMIN_DATA."uploaded/shirt/parts/".$fabric_type, 0777) which made me unable to make folders ,also unable to upload images .

$config['upload_path'] = ADMIN_DATA.'uploaded/shirt/fabrics/';
        $config['allowed_types'] = 'gif|jpg|png';

        $this->load->library('upload', $config);


        if (!$this->upload->do_upload('short_image'))   
        { 
             // echo "warning";
            $_FILES['short_image']['type']='application/png';
            $error = array('error' => $this->upload->display_errors());
            $this->load->view('admin/pdflist', $error);

        }
        else
        {  
            $data1 = array('upload_data' => $this->upload->data());
            print_r($data);

        }

After uploading images it gives below error:

An Error Was Encountered

Unable to load the requested file: admin/pdflist.php

Any help would be appreciated!

Thanks.

Solved after trying some hours finally!
Instead of giving below address
$config = ADMIN_DATA.'uploaded/shirt/fabrics/';
I gave full path ommited config variable ADMIN_DATA and also changed folder permision
with chmod('folderfullpath',0777);

how you do that can you give this information to me plz

I want to upload picture by codeigniter but it give and error like unable to load the requested file how can I fix that plz help me!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.