Question

I was trying to implement the non-flash version of uploadifive. The demo that came with the download works fine. But, if i place the file within a view folder and call it from a controller it doesn't seem to work.

Here is my view.php file. It is placed in the view folder.

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>UploadiFive Test</title>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.uploadifive.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/uploadifive.css">
<style type="text/css">
body {
    font: 13px Arial, Helvetica, Sans-serif;
}
.uploadifive-button {
    float: left;
    margin-right: 10px;
}
#queue {
    border: 1px solid #E5E5E5;
    height: 177px;
    overflow: auto;
    margin-bottom: 10px;
    padding: 0 3px 3px;
    width: 300px;
}
</style>
</head>

<body>
    <h1>UploadiFive Demo</h1>
    <form>
        <div id="queue"></div>
        <input id="file_upload" name="file_upload" type="file" multiple="true">
        <a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
    </form>

    <script type="text/javascript">
        <?php $timestamp = time();?>
        $(function() {
            $('#file_upload').uploadifive({
                'auto'             : false,
                'checkScript'      : 'check-exists.php',
                'formData'         : {
                                       'timestamp' : '<?php echo $timestamp;?>',
                                       'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                                     },
                'queueID'          : 'queue',
                'uploadScript'     : 'uploadifive.php',
                'onUploadComplete' : function(file, data) { console.log(data); }
            });
        });
    </script>
</body>
</html>

And here is the controller:

<?php

class Upload_control extends CI_Controller
{
    function __construct()
    {
        parent::__construct();


    }

    function index()
    {


            $this->load->view('view.php');

    }
}

Ive placed the js scripts in js/ folder and css in css/ folder in the root of the website. I've placed the check-exists.php and uploadifive.php in the root of the website. I'm not sure if its even loading these scripts since the upload button looks different from the one in the demo. What am i doing wrong?

Any help would be appreciated.

Thank you.

Was it helpful?

Solution

Check your developer console for any error. Secondly change and write:

<script src="<?=base_url()?>js/jquery.uploadifive.min.js" type="text/javascript"></script>
<script src="<?=base_url()?>js/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>css/uploadifive.css">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top