Welcome Guest, Not a member yet? Register   Sign In
You Did Not Select A File To Upload.
#1

[eluser]Zack Kitzmiller[/eluser]
I've seen messages on this, but no resolution.

Controller:
Code:
function index()
    {
    
        /* For now, all work will be done in controller */
        /* so sue me */
        
        $this->load->view('upload');
        
    }
    
    function upload() {
        
        echo "<pre>\n";
        print_r($_POST);
        print_r($_FILES);
    
    
        if ($this->input->post('upload_file')) {
    
            $config['upload_path'] = './uploads';
            $config['max_size'] = '2048';
            $this->load->library('upload', $config);
            
            if ($this->upload->do_upload('printery')) {
                print_r( $this->upload->data() );
            } else {
                print_r( $this->upload->display_errors() );    
            }        
        }
    }

The View:

Code:
&lt;form method="post" action="/index.php/welcome/upload" enctype="multipart/form-data" /&gt;

<div class="form_description">
    <h2>Get Started...</h2>
    <ul >
        <li>
            <label class="description" for="name">Your Name </label>
            &lt;input id="name" name="usr-name" class="element text medium" type="text" maxlength="255" value=""/&gt;
        </li>
        <li>
            <label class="description" for="email">Your Email </label>
            &lt;input id="email" name="email" class="element text medium" type="text" maxlength="255" value=""/&gt;
        </li>
        <li>
            <label class="description" for="element_2">Upload a File </label>
            &lt;input type="file" id="element_2" class="element file" name="printery" /&gt;
        </li>
        <li>
            &lt;input id="saveForm" class="button_text" type="submit" name="upload_file" value="Submit" /&gt;
        </li>
    </ul>
&lt;/form&gt;

Don't worry about the horrible horrible horrible class and id names. This form was given to me. I'll fix them later.

Any idea why i'm getting that error?


Messages In This Thread
You Did Not Select A File To Upload. - by El Forum - 09-22-2009, 10:40 AM
You Did Not Select A File To Upload. - by El Forum - 09-22-2009, 10:42 AM
You Did Not Select A File To Upload. - by El Forum - 09-25-2009, 02:16 PM
You Did Not Select A File To Upload. - by El Forum - 09-25-2009, 02:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB