Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter + plupload for file uploading
#3

[eluser]murphybr[/eluser]
instead of using PLupload, i used java upload.

all it took was 2 javascript files and my controller file + view to get an upload UI with the capability for single or multiple file uploads with the ability to upload (via chunking) files greater than 5GB.

view - upload.php
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
[removed]
    
    function uploaderFileMoved( uploader, file, oldIndex ) {
        traceEvent( "uploaderFileMoved, path=" + file.getPath() + ", oldIndex=" + oldIndex );
    }
    /**
     * file status changed notification
     */
    function uploaderFileStatusChanged( uploader, file ) {
        traceEvent( "uploaderFileStatusChanged, index=" + file.getIndex() + ", status=" + file.getStatus(2) + ", content=" + file.getResponseContent() );
    }
    /**
     * uploader status changed notification
     */
    function uploaderStatusChanged( uploader ) {
        traceEvent( "uploaderStatusChanged, status=" + uploader.getStatus() );
    }
[removed]

<div><b>&lt;?php echo "Max file upload limit: 1 file ";?&gt;</b>
</div><br>
&lt;applet name="jumpLoaderApplet"
        code="jmaster.jumploader.app.JumpLoaderApplet.class"
        archive="&lt;?php echo base_url()?&gt;javascript/jl_core_z.jar"
        width="715"
        height="500"
        mayscript&gt;
    <param name="uc_uploadUrl" value="&lt;?php echo base_url()?&gt;javascript/split_chunk.php"/>
    <param name="uc_partitionLength" value="1572864"/>
    <param name="uc_maxFiles" value="1"/>
    <param name="gc_loggingLevel" value="DEBUG"/>  
&lt;/applet&gt;
&lt;/html&gt;

controller - function placed in your main controller
Code:
function do_upload()
    {
        $DS = DIRECTORY_SEPARATOR;
        $this->user_upload_path = 'set/your/upload/path'
        
        $config['upload_path'] = $this->user_upload_path;
        $config['allowed_types'] = '*';
        $config['max_size']    = '0';
        $config['max_width']  = '0';
        $config['max_height']  = '0';

        $this->load->library('upload', $config);
            
        $data = array('upload_data' => $this->upload->data());
        $file = $data['upload_data']['file_name']; // file name for logging
        $this->load->view('upload');
    }

download the jl_core_z.jar file from the following site - http://jumploader.com/download.html and place it in the javascript folder.


Messages In This Thread
CodeIgniter + plupload for file uploading - by El Forum - 07-01-2011, 11:14 AM
CodeIgniter + plupload for file uploading - by El Forum - 07-18-2011, 02:01 AM
CodeIgniter + plupload for file uploading - by El Forum - 07-21-2011, 12:15 PM
CodeIgniter + plupload for file uploading - by El Forum - 07-21-2011, 12:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB