Welcome Guest, Not a member yet? Register   Sign In
Using SWFUpload + Sessions + upload class, how I did it.
#6

[eluser]CollinsSolutions[/eluser]
i am trying this same implementation but instead of uploading i am uploading to a database. Its not working for me. Here is my code

Code:
//you should have swfuploader POST your session id (youll see in the view)
    $params['session_id'] = $this->input->post("PHPSESSID");
    $this->load->library('session', $params);
    
        
    $upload_name = 'Filedata';
    print_r($_FILES);
    $count = 0;
    $count = count($_FILES[$upload_name]['size']);
    //echo $count;
    for($i = 1; $i <= $count-1; $i++):
        $fileName = $_FILES[$upload_name]['name'][$i];
        //echo 'Name is: ' . $fileName . '<BR>';
        $file = array(
        'name' => addslashes($fileName),
        'type' => $_FILES[$upload_name]['type'][$i],
        'size' => $_FILES[$upload_name]['size'][$i],
        'user_id' => $this->dx_auth->get_user_id());
        $tmpName  = $_FILES[$upload_name]['tmp_name'][$i];
        $content = read_file($tmpName);
        $content = addslashes($content);
        $file['content'] = $content;
        $this->db->insert('files', $file);
    endfor;
                

        $data['user_id'] = $this->dx_auth->get_user_id();
        $data['profile'] = $this->user_profile->get_profile($data['user_id']);
        $data['url'] = base_url();
        $data['site_url'] = site_url();
        $data['query'] = $this->db->get('portfolionames');
        $data['links'] = $this->db->query('SELECT * FROM links ORDER BY sort_order');
        $data['ownedfiles'] = $this->db->query('SELECT * FROM files WHERE user_id = ' . $this->dx_auth->get_user_id());
        $this->load->view('manage_view',$data);

Any ideas?


Messages In This Thread
Using SWFUpload + Sessions + upload class, how I did it. - by El Forum - 03-12-2009, 01:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB