{if !$authMsg} {form name='uploadForm'} {foreach from=$formData key='formEl' item='value'} {/foreach}
{label name=$formEl} {input name=$formEl}
{error name=$formEl}
{text key='groupfiles+max_file_size_limit'} {$maxSize} MB
{text key='groupfiles+allowed_file_extensions'}
{$allowedExtnLabel}
{submit name="addFile" class='ow_ic_save'}
{/form} {script} {literal} $('#upload').ajaxupload({ url:{/literal}{$uploadAction}{literal}, remotePath:{/literal}{$filesDir}{literal}, flash:'{/literal}{$flashURL}{literal}uploader.swf', maxFiles : 1, allowExt:[{/literal}{$allowedExtn}{literal}], editFilename:true, maxFileSize: '{/literal}{$maxSize}{literal}M', form:'#THEFORM', success: function(files) { }, beforeUpload: function(filename, fileobj){ if(fileobj.fileSize/1024/1024 >{/literal}{$maxSize} || fileobj.fileSize == 0{literal}){ return false; } else { return true; } }, error: function(err,fileName) { alert(err); } }); $('#THEFORM').bind('submit', function(){ //ON FORM SUBMIT VALIDATE IF FILES HAD BEEN SELECTED var ajax_upload = $('#upload').data('AU'); var selected_files = ajax_upload.files; //IF NO FILE SELECTED DO NOT SUBMIT THE FORM if(selected_files.length==0){ alert('Select any file first'); return false; } }); {/literal} {/script} {style} {literal} .ax-prev-container{ display:none; } .ax-upload-all { display:none; } .ax-clear { display:none; } .ax-legend { display:none; } {/literal} {/style} {else}
{$authMsg}
{/if}