<script type="text/javascript" charset="utf-8">
$(function() {
$('.startupload').click(function(event) {
console.log('teste');
$('#file_upload').uploadify({
'uploader' : '../_SWF/uploadify.swf',
'script' : '../uploadify.php',
'cancelImg' : '../_IMAGES/cancel.png',
'folder' : '<?php echo $vgcoreMidia."/galeriadeimagens/".$_GET["id"]."/gal"; ?>',
'multi' : true,
'auto' : false,
'fileDataName' : 'Filedata',
'onInit' : function(event){
// console.log(event);
},
'onComplete' : function(event, ID, fileObj, response, data) {
$.ajax({
type: "POST",
url: "propUpGalleries.php",
data: "imagename="+fileObj.name+"&id=<?php echo $_GET['id'] ?>",
success: function(msg){
console.log(data);
}
});
},
'onError' : function(event,data) {
// console.log(event);
// console.log(data);
},
'onAllComplete' : function(event,data) {
window.opener.location.reload();
}
});
});
});
</script>
<a href="javascript:$('#file_upload').uploadifyUpload()" class="startupload">Iniciar upload de imagens</a>
Returns the following error in the console:
jquery.uploadify.v2.1.4.js:282 Uncaught TypeError: document.getElementById(...).startFileUpload is not a function
On line:
uploadifyUpload:function(ID,checkComplete) {
jQuery(this).each(function() {
if (!checkComplete) checkComplete = false;
document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, checkComplete);
});
},