CodeIgniter Forums
Getting uri-> segment on swfupload for model (database purpose) return nothing ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Getting uri-> segment on swfupload for model (database purpose) return nothing ? (/showthread.php?tid=21803)



Getting uri-> segment on swfupload for model (database purpose) return nothing ? - El Forum - 08-21-2009

[eluser]Triple_vent[/eluser]
Hi...all
i got this http://ellislab.com/forums/viewthread/70611/#419535 (thanks for Merolen) related to how to use the SWFuploader in CI, but i got some issues, coz in that thread it just for uploading, when i adding new line on my do_upload() function to get the uri->segment from my address it return nothing...

is there any others method to get the uri before uploading (with .swf) conducted ?

the address of my page :
Code:
http://localhost/ci/index.php/aset/gallery_new/25

my controller
Code:
class Upload extends Controller {
    
    function Upload()
    {
        parent::Controller();
        
        
       [i] $id=$this->uri->segment(3);[/i]
        
        
        $m='./uploads/'.$id;
        $config['upload_path'] = $m;
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '1000';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        
        $this->load->library('upload', $config);
    }
    
    function do_upload()
    {
        $this->upload->do_upload('Filedata');
        $res = $this->upload->data();

        echo $res['file_name'];
    }

Thanks for any help


Getting uri-> segment on swfupload for model (database purpose) return nothing ? - El Forum - 08-21-2009

[eluser]Triple_vent[/eluser]
my fools, this can be done easily....just add the
Code:
post_params: {"id" : "<?php echo $id ?>"},
on the swf scripts on the view, then catch that with
Code:
$id=$_POST["id"];


What a shamed this solved by myself by just reading other example source code
By the way thanks for reading my messages