Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
PHP File Uploader
»
Re: Can I limit the upload size of all files ?
Re: Can I limit the upload size of all files ?
12-30-2009, 6:17 PM
cutechat
Joined on 07-22-2004
Posts 2,332
Re: Can I limit the upload size of all files ?
Reply
Quote
Yakir,
Please try this script:
<script> function CuteWebUI_AjaxUploader_OnSelect(selects) { var uploader=this; var queues=uploader.getitems(); var queuesize=0; for(var i=0;i<queues.length;i++) { if(queues[i].Status=="Error") continue; queuesize+=queues[i].FileSize; } var selectsize=0; for(var i=0;i<selects.length;i++) { selectsize+=selects[i].FileSize; } var totalsize=queuesize+selectsize; if(totalsize>10*1024*1024) { alert("you cant upload 10M files"); return false; } } </script>
This is just client side behavior.
You need also validate the total size on server side.
Regards,
Terry
View Complete Thread