• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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, 09:30 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 09:59 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 10:01 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 10:10 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 10:15 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 10:24 AM
i cant upload any thing except picture - by El Forum - 03-15-2011, 02:20 PM
i cant upload any thing except picture - by El Forum - 03-15-2011, 03:40 PM
i cant upload any thing except picture - by El Forum - 03-15-2011, 04:02 PM
i cant upload any thing except picture - by El Forum - 03-16-2011, 03:00 AM
i cant upload any thing except picture - by El Forum - 03-16-2011, 08:50 AM
i cant upload any thing except picture - by El Forum - 03-17-2011, 12:16 PM
i cant upload any thing except picture - by El Forum - 03-18-2011, 02:44 PM
i cant upload any thing except picture - by El Forum - 03-18-2011, 02:58 PM
i cant upload any thing except picture - by El Forum - 03-19-2011, 02:04 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 08:36 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 09:59 AM
i cant upload any thing except picture - by El Forum - 03-20-2011, 02:16 PM
i cant upload any thing except picture - by El Forum - 03-21-2011, 01:13 PM
i cant upload any thing except picture - by El Forum - 03-21-2011, 04:34 PM
i cant upload any thing except picture - by El Forum - 03-22-2011, 02:57 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 03:07 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 04:45 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 04:53 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 04:57 AM
i cant upload any thing except picture - by El Forum - 03-22-2011, 06:37 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.