[eluser]DavidBer[/eluser]
Continued.
upload.js
Code:
$(function() {
$("#uploader").plupload({
// General settings
runtimes : 'gears,flash,html5',
url : 'diva/process_upload',
max_file_size : '1000mb',
chunk_size : '1mb',
unique_names : true,
// Resize images on clientside if we can
// resize : {width : 320, height : 240, quality : 90},
// Specify what files to browse for
filters : [
{title : "Document files", extensions : "doc,docx,txt,xls,ppt,pdf"},
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Video files", extensions : "avi,wmv,qt"},
{title : "Audio files", extensions : "mp3,flac"},
{title : "Zip files", extensions : "zip"}
],
// Flash settings
flash_swf_url : 'assets/scripts/plupload.flash.swf',
});
// Client side form validation
$('form').submit(function(e) {
var uploader = $('#uploader').pluploadQueue();
// Validate number of uploaded files
if (uploader.total.uploaded == 0) {
// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('UploadProgress', function() {
if (uploader.total.uploaded == uploader.files.length)
$('form').submit();
});
uploader.start();
} else
alert('You must at least upload one file.');
e.preventDefault();
}
});
});
views/diva
Code:
...
<div class="upload">
<p>Select some files to upload</p>
<?php echo form_open('diva/process_upload'); ?>
<div id = "uploader">You need Google Gears, Flash or HTML5</div>
<?php form_close(); ?>
</div><!-- end upload div -->
The generated page has all the css/js files and I have clicked to make sure they are there and load.
Anyone have any ideas why I am not even getting the widget to show up? Granted, I have not slept in about 20 hours and am probably just missing something very easy, but I can't find it.
Thanks.