• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
jquery is not working with blueimp upload

#1
[eluser]bill19[/eluser]
Hi everyone,

I am trying to build an upload page using the blueimp jquery upload plugin

https://github.com/blueimp/jQuery-File-U...odeIgniter

The file upload is working, but the jquery/ajax component is not. I am not experienced with javascript/Jquery, Is there any obvious problems in this code preventing jquery from working?

Thank you,

Bill




Here is the controller:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Upload extends CI_Controller {

public function __construct()
{
  parent::__construct();
  $this->load->helper(array('form', 'url'));
}

public function index()
{
  $this->load->view('form', array('error' => ''));
}

public function do_upload()
{
  $config['upload_path'] = FCPATH.'uploads/';
  $config['allowed_types'] = 'gif|jpg|png|jpeg';
  $config['max_size'] = '36000';
  $config['max_width'] = '10240';
  $config['max_height'] = '76800';

  $this->load->library('upload', $config);

  if ( ! $this->upload->do_upload())
  {
   $error = array('error' => $this->upload->display_errors());

   $this->load->view('form', $error);
  }
  else
  {
   $data['upload_data'] = $this->upload->data();
   $this->load->view('success', $data);
  }
}
}
// End of file upload

Here is the view;

Code:
<html>
<head>
<title>Upload Form</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" id="theme">
<link rel="stylesheet" href="http://dl.dropbox.com/u/8626323/dnd/jquery.fileupload-ui.css">
<style>
body {
  font-family: Verdana, Arial, sans-serif;
  font-size: 13px;
  margin: 0;
  padding: 20px;
}
</style>
</head>
<body>
  <?php echo $error;?>
  <?php echo form_open_multipart('upload/do_upload', array('id' => 'file_upload')); ?>
   <input type="file" name="userfile" multiple />
   <button>Upload</button>
   <div>Upload files</div>
  &lt;?php echo form_close(); ?&gt;
  <table id="files"></table>
   [removed][removed]
   [removed][removed]
   [removed][removed]
   [removed][removed]
   [removed]
   /*global $ */
   $(function () {
    $('#file_upload').fileUploadUI({
    uploadTable: $('#files'),
    downloadTable: $('#files'),
    buildUploadRow: function (files, index) {
    return $('<tr><td>' + files[index].name + '<\/td>' +
     '<td class="file_upload_progress"><div><\/div><\/td>' +
     '<td class="file_upload_cancel">' +
     '<button class="ui-state-default ui-corner-all" title="Cancel">' +
     '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
     '<\/button><\/td><\/tr>');
    },
    buildDownloadRow: function (file) {
     return $('<tr><td>' + file.name + '<\/td><\/tr>');
    }
    });
   });
   [removed]
&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
jquery is not working with blueimp upload - by El Forum - 05-25-2012, 01:34 PM
jquery is not working with blueimp upload - by El Forum - 05-25-2012, 02:49 PM
jquery is not working with blueimp upload - by El Forum - 05-25-2012, 09:05 PM
jquery is not working with blueimp upload - by El Forum - 05-25-2012, 09:37 PM
jquery is not working with blueimp upload - by El Forum - 05-25-2012, 09:45 PM
jquery is not working with blueimp upload - by El Forum - 05-28-2012, 10:45 AM
jquery is not working with blueimp upload - by El Forum - 05-28-2012, 10:50 AM
jquery is not working with blueimp upload - by El Forum - 05-28-2012, 11:21 AM
jquery is not working with blueimp upload - by El Forum - 05-28-2012, 01:19 PM
jquery is not working with blueimp upload - by El Forum - 05-29-2012, 07:40 AM
jquery is not working with blueimp upload - by El Forum - 05-30-2012, 07:10 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.