Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [controller]
- $config = array(
- 'upload_path' => './resources/uploads'
- , 'allowed_types' => 'gif|jpg|png'
- , 'max_size' => '1000000000'
- , 'max_width' => '2048'
- , 'max_height' => '1024'
- );
- $this->upload->initialize($config);
- $pic = '';
- if (isset($_FILES["userfile"]["name"])){
- if ( ! $this->upload->do_upload()){
- }else{
- $tGambar = $this->upload->data();
- $pic = $tGambar["file_name"];
- }
- }else{
- $pic = '';
- }
- [view]
- <?php
- $attributes = array('class' => 'form_container', 'id' => 'myform');
- echo form_open_multipart('administrator/item/do_item',$attributes);
- ?>
- <input type="file" name="userfile" id="userfile" class="file_1" />
- <?php echo '</form>';?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement