Part of the EllisLab Network
   
 
Upload Class CI 1.5.0.1 and WinXP
Posted: 09 November 2006 11:40 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  111
Joined  09-21-2006

http://codeigniter.com/forums/viewthread/46659/


Function validate_upload_path() in libraries/Upload.php:

function validate_upload_path()
    
{    
        
if ($this->file_path == '')
        
{
            $this
->set_error('upload_no_filepath');
            return
FALSE;
        
}
....

i change it for taste to :

function validate_upload_path()
    
{    

echo $this->file_path;

        if (
$this->file_path == '')
        
{
            $this
->set_error('upload_no_filepath');
            return
FALSE;
        
}
....

And when teste it there is no echo from $this->file_path
like $config[’upload_path’] is empty.

Profile
 
 
Posted: 09 November 2006 12:27 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  111
Joined  09-21-2006

tested on linux now. also doesnt work.
It’s origianl release from site. Not upgrade…

Profile
 
 
Posted: 11 November 2006 02:27 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2505
Joined  12-21-2001

Are you running version 1.5?  I believe you need to set:

$this->upload_path

 Signature 
Profile
MSG
 
 
Posted: 20 March 2007 10:59 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Avatar
Total Posts:  7
Joined  09-26-2006

I have same problem. I am using CI 1.5 with XAMPP in Windows XP. And then after I looking at Upload.php, I make fix code like this in controller :

$config['upload_path'] = './images/';
        
$config['allowed_types'] = 'gif|jpg|png|jpeg';
        
$config['max_size']    = '100';
        
$config['max_width']  = '1024';
        
$config['max_height']  = '768';
        
$this->load->library('upload', $config);
        
        
$this->upload->set_upload_path($config['upload_path']);
        
$this->upload->set_allowed_types($config['allowed_types']);
        
        if ( !
$this->upload->do_upload())
        
{
            $error
= array('error' => $this->upload->display_errors());
                    echo
print_r($error);
                    echo
"<br>" . print_r($this->upload->data());
        
}
        
else
        
{
                    
//Do something success
        
}

And bravo, the code is work fine for me and file can be uploaded!!!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66412 Total Logged-in Users: 31
Total Topics: 84750 Total Anonymous Users: 1
Total Replies: 454811 Total Guests: 215
Total Posts: 539561    
Members ( View Memberlist )
Newest Members:  NirCalexmuellerkizerdrixcaptainredmuffquinodligtharttechsivamDjordjesammozzazodman23