| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/itms.arukustech.com/public/js-not-using/ |
Upload File : |
(function(){var f=document.querySelector('form[enctype="multipart/form-data"]');if(!f)return;var i=f.querySelector('input[type="file"][name="attachments[]"]');if(!i)return;var M=2*1024*1024,T=10*1024*1024,A=['pdf','doc','docx','xls','xlsx','zip','png','jpg','jpeg','txt','csv'];function e(n){var p=n.lastIndexOf('.');return p>=0?n.slice(p+1).toLowerCase():''}function b(n){if(n<1024)return n+' B';if(n<1024*1024)return(n/1024).toFixed(1)+' KB';return(n/1024/1024).toFixed(1)+' MB'}function v(files){var errs=[],total=0;for(var j=0;j<files.length;j++){var f=files[j],x=e(f.name);total+=f.size;if(A.indexOf(x)===-1)errs.push('Not allowed: '+f.name);if(f.size>M)errs.push('Too large: '+f.name+' ('+b(f.size)+', max 2 MB)')}if(total>T)errs.push('Total size '+b(total)+' exceeds 10 MB');return{ok:errs.length===0,errs:errs,total:total}}f.addEventListener('submit',function(ev){var files=i.files||[];if(files.length===0)return;var r=v(files);if(!r.ok){ev.preventDefault();alert(r.errs.join('\n'));}});var dz=document.createElement('div');dz.style.border='2px dashed #bbb';dz.style.borderRadius='10px';dz.style.padding='12px';dz.style.textAlign='center';dz.style.marginTop='8px';dz.textContent='Drag & Drop files here (or click the file input)';i.parentNode.insertBefore(dz,i.nextSibling);['dragenter','dragover'].forEach(function(evt){dz.addEventListener(evt,function(e){e.preventDefault();dz.style.background='#f8f9ff';});});['dragleave','drop'].forEach(function(evt){dz.addEventListener(evt,function(e){e.preventDefault();dz.style.background='';});});dz.addEventListener('drop',function(e){e.preventDefault();var dt=e.dataTransfer;if(!dt||!dt.files)return;var r=v(dt.files);if(!r.ok){alert(r.errs.join('\n'));return;}var data=new DataTransfer();Array.from(i.files||[]).forEach(function(f){data.items.add(f)});Array.from(dt.files).forEach(function(f){data.items.add(f)});i.files=data.files;});window.addEventListener('beforeunload',function(e){if((i.files||[]).length>0){e.preventDefault();e.returnValue='';}});})();