Can I limit the upload size of all files ?

Last post 12-31-2009, 1:58 PM by yakar. 9 replies.
Sort Posts: Previous Next
  •  12-27-2009, 6:57 PM 57940

    Can I limit the upload size of all files ?

    Hey,

    how i can to limit the upload size of all files together and not limitation of only one file?

     

    Yakir.


  •  12-28-2009, 5:05 PM 57955 in reply to 57940

    Re: Can I limit the upload size of all files ?

    hey
     
    I need something like this script
     
    <script type="text/javascript">

    var count=0;

    function CuteWebUI_AjaxUploader_OnSelect(files)

       {
     
          count+=files.length;

          alert("you selected "+count+" files");

       }

       </script>

     
    and the alret will be : the maximum alowed size of all the file is 200 mega .
     
    somebody can help me with this script ?  im sure that this script can be helpful for aloot o paeople here.
  •  12-28-2009, 11:08 PM 57960 in reply to 57955

    Re: Can I limit the upload size of all files ?

    Dear yakar,
     
    Please use the following code:
     
    function CuteWebUI_AjaxUploader_OnSelect(files)
     {
        alert("CuteWebUI_AjaxUploader_OnSelect");
         for(var i=0;i<files.length;i++)
         {
               alert(files[i].FileSize);
               size +=  files[i].FileSize;
         }  
           count+=files.length;
           alert("you selected "+count+" files");
           alert("total size" + size);  
           if(size>200*1024*1024)
          {
                  alert("the maximum alowed size of all the file is 200M ");
          }
     }
     
    Regards,
    Eric
  •  12-29-2009, 7:45 AM 57964 in reply to 57960

    Re: Can I limit the upload size of all files ?

    thenk you .
     
    but the part :
          count+=files.length;
           alert("you selected "+count+" files");
           alert("total size" + size);  
           if(size>200*1024*1024)
          {
                  alert("the maximum alowed size of all the file is 200M ");
          }
     
    dont show to me never .
     
    and i need to not alow to upload the file if the size of all the files move the 200 mega , how can i do it ?
     
    thenk you . :)
  •  12-29-2009, 2:28 PM 57969 in reply to 57964

    Re: Can I limit the upload size of all files ?

    Dear yakar,
     
    Did you change the size?  Only size is greater than 200*1024*1024 bytes, that message can be displayed, you can change the value of size to 200,and then test it.
     
    Regards,
    Eric
     
  •  12-29-2009, 5:08 PM 57974 in reply to 57964

    Re: Can I limit the upload size of all files ?

    yakar:
    thenk you .
     
    but the part :
          count+=files.length;
           alert("you selected "+count+" files");
           alert("total size" + size);  
           if(size>200*1024*1024)
          {
                  alert("the maximum alowed size of all the file is 200M ");
          }
     
    dont show to me never .
     
    and i need to not alow to upload the file if the size of all the files move the 200 mega , how can i do it ?
     
    thenk you . :)
     
    Please try the following property:
     

    Uploader.MaxSizeKB Property

    Gets or sets the maximum allowed size of the file, in KB.


    Example Code

    1. <?php require_once "phpuploader/include_phpuploader.php" ?>   
    2. <html>   
    3. <body>   
    4.         <form id="form1" method="POST">   
    5.             <?php   
    6.                 $uploader=new PhpUploader();   
    7.                 $uploader->Name="myuploader";   
    8.                 $uploader->MaxSizeKB=1024;   
    9.                 uploader->Render();   
    10.             ?>   
    11.         </form>   
    12. </body>   
    13. </html>  

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-30-2009, 9:53 AM 57988 in reply to 57969

    Re: Can I limit the upload size of all files ?

    yes i change the number . but it dosent work for me .
     
    how i can to dont allow to add a file if the size of all the files will move the 200MB ( or what i want) in realtime check  (in onselect)
  •  12-30-2009, 10:35 AM 57989 in reply to 57988

    Re: Can I limit the upload size of all files ?

    Can you try the following example?
     
    4. Simple Upload with Progress (Custom Validation)
    A sample demonstrates how to create user-defined validation functions for an upload control.
     
    Maximum file size allowed to upload is set to 100K.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-30-2009, 6:17 PM 58001 in reply to 57940

    Re: Can I limit the upload size of all files ?

    Yakir,
     
    Please try this script:
     
     
    This is just client side behavior.
     
    You need also validate the total size on server side.
     
     
    Regards,
    Terry
  •  12-31-2009, 1:58 PM 58007 in reply to 58001

    Re: Can I limit the upload size of all files ?

    No script here work for me.
    I can not display the total files size.
    All files not one file

    I did not understand how I do not allow to upload file if the files with him move the size i choose
     
    thenk for all
View as RSS news feed in XML