Welcome Guest, Not a member yet? Register   Sign In
upload problem
#1

[eluser]eabihaydar[/eluser]
I am having this problem with my upload page:

404 Page Not Found
The page you requested was not found.


Controller Code:

Code:
<?php

class Gallery extends Controller {
    
    function __construct()
    {
        parent::Controller();
        $this->load->helper(array('form', 'url'));
        
        
    }
    
    function index()
    
    {    
        $this->load->library('upload');
        $this->load->view('ulpoad_photo');
    }

    function do_upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '100';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        
        $this->load->library('upload', $config);
    
        if ( ! $this->gallery->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            $this->load->view('ulpoad_photo', $error);
        }    
        else
        {
            $data = array('ulpoad_data' => $this->upload->data());
            
            $this->load->view('upload_success', $data);
        }
    }    
}?>

View Code:

Code:
<html>
<head>
<title>Upload Photo</title>
</head>
<body>



<?php echo form_open_multipart('upload/do_upload');?>


<input type="file" name="userfile" size="20" />

<br /><br />

&lt;input type="submit" value="upload" /&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;

Please Help.
Many Thanks
#2

[eluser]Prokium[/eluser]
Hi


When have you the 404 not found? On the submit? or when you call the index of the class gallery?
#3

[eluser]eabihaydar[/eluser]
Hi,

On the submit.

thanks
#4

[eluser]Prokium[/eluser]
change
Code:
if ( ! $this->gallery->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            $this->load->view('ulpoad_photo', $error);
        }

to

Code:
if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            
            $this->load->view('ulpoad_photo', $error);
        }

You call a "bad " library i think.




Theme © iAndrew 2016 - Forum software by © MyBB