When I am trying to upload file the error is coming like Uncaught TypeError: Cannot read property 'apply' of undefined
assignmnet.php
<form id="assignmentsubmit">
<div class="submityourwork">
<h4 class="sm bold">Submit your work</h4>
<div class="text-form-editor">
<img src="<?php echo base_url()?>/public/images/editor-demo-1.jpg" alt="">
<input type="hidden" name="cid" value="<?php echo $courseId?>"/>
<input type="hidden" name="tid" value="<?php echo $topicId?>"/>
<input type="hidden" name="uid" value="<?php echo $user?>"/>
<input type="hidden" name="content" value=""/>
<input type="text" placeholder="Title of text" name="title">
<textarea placeholder="Your content start here" name="description"></textarea>
</div>
</div>
<div id="disc"></div>
<div class="form-action">
<a href="javascript:void(0);"><i class="icon md-upload"></i></a>
<div class="tr-file reffile" style="display:none">
<ul>
<li class="form-item">
<a href="javascript:void(0);" class="trigger-file">
<span class="name-file refname"></span>
<span class="size-file refsize"></span>
</a>
<a href="javascript:void(0);" class="close-file">
<i class="icon md-close-2 referenceclose"></i>
</a>
</li>
</ul>
</div>
<div id="contentupload" ></div>
</div>
<input type="submit" id ="switch" value="Submit" class="abc submit mc-btn-3 btn-style-1">
</form>
The above code is my html code to select a file from here.
The js is in the same file like below
<script>
var urljs = "<?php echo base_url()?>";
</script>
<script>
$("#contentupload").uploadify({
height : 30,
swf : urljs+'/public/js/uploadify.swf',
uploader : urljs+'/user/UploadifyController/uplaodfiles',
folder : "../../../uploads",
width : 120,
fileSizeLimit : '150MB',
fileTypeDesc : 'Video Files',
fileTypeExts : '*.mp4; *.flv',
debug : false,
removeCompleted : false,
formData : {
folder : '../../private/<?php echo $userId;?>/beforeconvert',
folder1 : '../../private/<?php echo $userId;?>'
},
onSelect: function(file) {
alert('fdsdsfdsfdsfdsf');
$("#contentupload-queue").find(".uploadify-queue-item:not(':last')").each(function(){
var contentUploadQueueID = $(this).attr('id');
var files = $('#contentupload').data('uploadify').queueData.files;
delete files[contentUploadQueueID];
$(this).remove();
});
},
onUploadStart : function(file) {
appendContentInputElement();
disableSwitchBtn();
},
onUploadSuccess : function(file, data, response) {
$("[name=content]").val(file.name);
$(".reffile").show();
$(".refname").text(file.name);
$(".refsize").text(file.size);
$("#contentupload-queue").empty();
removeContentInputElement();
enableSwitchBtn();
},
onUploadError : function(file, errorCode, errorMsg, errorString) {
removeBannerInputElement();
enableSwitchBtn();
},
onCancel : function(file) {
removeBannerInputElement();
enableSwitchBtn();
}
});
function appendContentInputElement(){
$("#assignmentsubmit").prepend("<input type='hidden' class='basic_information_element' name='basic_element_content' value='uploading.....'>");
}
function disableSwitchBtn(){
$("#switch").attr("disabled", true).addClass("stbtn-yle-6").removeClass("btn-style-1").val("Uploading ...");
}
function removeContentInputElement(){
$("#assignmentsubmit").find('input[name=basic_element_content]').remove();
}
function enableSwitchBtn(){
if($("input.basic_information_element").length <= 0){
$("#switch").attr("disabled", false).addClass("btn-style-1").removeClass("btn-style-6").val("Submit");
}
}
$(document).ready(function(){
cancelreference();
function cancelreference(){
$('.referenceclose').unbind("click");
$('.referenceclose').on("click",function(e){
$(".reffile").hide();
$("[name=content]").val("");
e.preventDefault();
});
}
})
</script>
When I clicked to select a file window is opened to select a video but it not selected and nothing shows in chrome network tool.