Welcome Guest, Not a member yet? Register   Sign In
i cant upload any thing except picture
#26

[eluser]allaerd[/eluser]
i made it a bit more simple. But it works for me. See allaerd.org/test

view:
Code:
<!DOCTYPE html>
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Welcome to CodeIgniter&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;?php echo form_open_multipart('welcome/final_step'); ?&gt;
<p>
    Select art screen :
    &lt;input type="file" name="screen" size="10"&gt; ( jpeg , jpg , png , gif )
</p>    
<p>
    Select art source :
    &lt;input type="file" name="source" size="10"&gt; ( psd , zip , rar , cdr , ai )
</p>
<p align="center">
    &lt;input class="btn" type="submit" value="Submit" name="send_art"&gt;
</p>
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

controller:
Code:
function final_step () {
        
        // Load Upload Library
        $this->load->library('upload');
        // Set upload rules for screen
        $config['upload_path'] = '../files/shop/';
        $config['allowed_types'] = 'jpg|png|gif';
        $config['max_size']    = '200';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        $this->upload->initialize($config);
        //do upload screen
        if( ! $this->upload->do_upload('screen'))
        {
            echo('Screen error :' . $this->upload->display_errors() . '---<br>');
        }
        print_r( $this->upload->data());
        echo '<hr>';
        // Set upload rules for source
        $config['upload_path'] = '../files/shop/source/';
        $config['allowed_types'] = 'zip|rar|cdr|psd|ai';
        $config['max_size']    = '24000';
        $this->upload->initialize($config);
        //do upload source
        if ( ! $this->upload->do_upload('source'))
        {
            die('Source error :' . $this->upload->display_errors());
        }
        print_r( $this->upload->data());
    }


Messages In This Thread
i cant upload any thing except picture - by El Forum - 03-15-2011, 08:30 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 08:59 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 09:01 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 09:10 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 09:15 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 09:24 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 01:20 PM
i cant upload any thing except picture - by El Forum - 03-15-2011, 02:40 PM
i cant upload any thing except picture - by El Forum - 03-15-2011, 03:02 PM
i cant upload any thing except picture - by El Forum - 03-16-2011, 02:00 AM
i cant upload any thing except picture - by El Forum - 03-16-2011, 07:50 AM
i cant upload any thing except picture - by El Forum - 03-17-2011, 11:16 AM
i cant upload any thing except picture - by El Forum - 03-18-2011, 01:44 PM
i cant upload any thing except picture - by El Forum - 03-18-2011, 01:58 PM
i cant upload any thing except picture - by El Forum - 03-19-2011, 01:04 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 07:36 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 08:59 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 01:16 PM
i cant upload any thing except picture - by El Forum - 03-21-2011, 12:13 PM
i cant upload any thing except picture - by El Forum - 03-21-2011, 03:34 PM
i cant upload any thing except picture - by El Forum - 03-22-2011, 01:57 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 02:07 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 03:45 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 03:53 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 03:57 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 05:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB