0

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.

Edited by Nick Evan: Fixed formatting

1
Contributor
1
Reply
6
Views
5 Years
Discussion Span
Last Post by nalini@121
0

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);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.