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";
            $error = array('error' => $this->upload->display_errors());
            $this->load->view('admin/pdflist', $error);

            $data1 = array('upload_data' => $this->upload->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!


Edited by Nick Evan: Fixed formatting

6 Years
Discussion Span
Last Post by Mohammadjan

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


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!

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.