It looks like you're new here. If you want to get involved, click one of these buttons!
jQuery('#file_upload').uploadify({
'uploader' : 'swf/uploadify.swf',
'script' : 'upload.php',jQuery('#file_upload').uploadify({
'uploader' : 'swf/uploadify.swf',
'script' : 'http://www.mysite.com/index.php?option=com_component&task=adtest&format=row',
<script>
jQuery(document).ready(function() {
var file_upload = jQuery('#file_upload');
file_upload.uploadify({
'uploader' : 'http://localhost/mysite/administrator/components/com_mycomponent/myfolder/uploadify.swf',
'script' : 'http://localhost/mysite/index.php',
'cancelImg' : 'http://localhost/mysite/administrator/components/com_mycomponent/myfolder/cancel.png',
'folder' : '/path/to/mysite/images',
'auto' : false,
'multi' : true,
'method' : 'post',
'scriptData' : {},
'fileDataName' : 'file[]',
'onError' : function(event, ID, fileObj, errorObj) {
alert('error');
}
});
jQuery.extend(jQuery.fn,{
clickUpload : function(ID,checkComplete) {
jQuery(this).each(function() {
if (!checkComplete) checkComplete = false;
var ids = new Array();
var file_upload = jQuery(this);
var descriptionfield = jQuery('.descriptionfield');
jQuery('.uploadifyQueueItem').each(function(index) {
desc = jQuery(descriptionfield[index]).attr('value');
file_upload.uploadifySettings('scriptData',{
'option' :'com_mycomponent',
'Itemid' :10,
'section' :'filemanager_pro',
'workspace' :20,
'task' :'task_save_file',
'format' :'raw',
'<?php echo JUtility::getToken();//Joomla token. ?>' :1,
'lang' :'en',
'dir' :1,
'description' :[desc]
},true);
ids[index] = jQuery(this).attr('id').replace('file_upload', '');
ID = ids[index];
document.getElementById(file_upload.attr('id') + 'Uploader').startFileUpload(ID, checkComplete);
});
});
}
});
var settings = file_upload.data('settings');
file_upload.unbind('uploadifySelect');
file_upload.bind('uploadifySelect', {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
if (event.data.action(event, ID, fileObj) !== false) {
var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
var suffix = 'KB';
if (byteSize > 1000) {
byteSize = Math.round(byteSize *.001 * 100) * .01;
suffix = 'MB';
}
var sizeParts = byteSize.toString().split('.');
if (sizeParts.length > 1) {
byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
} else {
byteSize = sizeParts[0];
}
if (fileObj.name.length > 20) {
fileName = fileObj.name.substr(0,20) + '...';
} else {
fileName = fileObj.name;
}
queue = '#' + jQuery(this).attr('id') + 'Queue';
if (event.data.queueID) {
queue = '#' + event.data.queueID;
}
jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
<div class="cancel">\
<a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
</div>\
<div class="desc">description:<input type="text" size="30" name="description[]" class="descriptionfield" value="" /></div>\
<span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
<div class="uploadifyProgress">\
<div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
</div>\
</div>');
}
});
});
</script>
<input id="file_upload" name="file_upload" type="file" />
<a href="javascript:jQuery('#file_upload').clickUpload()">Upload Files</a>