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?
#2

[eluser]Zack Kitzmiller[/eluser]
Resolved, I'm an idiot.
#3

[eluser]Mahmoud M. Abdel-Fattah[/eluser]
can you share how did you solve it ?
#4

[eluser]Zack Kitzmiller[/eluser]
You have to specify a max height and width. Just set them to 0 for no restrictions.




Theme © iAndrew 2016 - Forum software by © MyBB