How to count and control concurrent uploading users?

5 posts, 0 answers
  1. X
    X avatar
    4 posts
    Member since:
    Mar 2013

    Posted 04 Apr 2013 Link to this post

    I use RadAsyncUpload to process multiple files upload online. I want to make an uploading queue with certain length.

    Tow questions:

    Q1: How to count the concurrent uploading users, exclude those who browse this page without uploading.

    Q2: If the count meets max-queue-length, is it possible to make the RadAsyncUpload waiting until the count < max-queue-length, after the files selection on the client.

    I've searched the forum, but found nothing concerning my question. Is there any suggestion?
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 09 Apr 2013 Link to this post

    Hello,

    If you want to have statistics of those users who upload files you could store their Usernames, ID or their IP addresses if they are not registered when they upload files in a log or in a database.  This can be done in the OnFileUploaded event for example.

    Regarding your second question: the feature where you can reorder file upload list is not currently supported by RadAsyncUpload control.

    Kind regards,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. X
    X avatar
    4 posts
    Member since:
    Mar 2013

    Posted 10 Apr 2013 Link to this post

    What I want is to limit the amount of users who can upload files concurrently. When the amount reach to the limitation, those users, who select files on their client to upload, would be put into a upload-waiting queue. Until a user finished his uploading, one user, in the waiting queue, will be allowed to start the uploading progress.

    For example, the concurrent uploading limitation is 10 users. When the 11th user select files on his client to start uploading progress, he would be put into the waiting queue. Only after one of those 10 users finished uploading, the 11th user is allowed to upload.

    1. I need to count users who are uploading files (not those who uploaded files), so, I think that OnFilesUploaded (be fired after file uploaded) could not count online uploading users.

    2. While the upload files selection finished, the upload progress start immediately. I want to know if it is possible to make the RadAsyncUpload start uploading after a while delay (not immediately). 
  5. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 15 Apr 2013 Link to this post

    Hi,

    You could try to define an application variable, increase its value every time when the user start uploading and decrease it after the upload finishes.

    All the best,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 15 Apr 2013 Link to this post

    Hello,

    One approach could be to define an Application Variable where to store the count of users uploading files. Its value will be changed via Web Service. For example:

    WebService.asmx defines three Web methods
    • GetUploaders()
    • IncreaseUploaders()
    • DecreaseUploaders()
    Then handle OnClientFileUploading event and call GetUploaders() to see if the user is allowed to start uploading. If he is allowed we call IncreaseUploaders() to increase the number of the uploaders, if he is not then we cancel file uploading.

    Finally when file is uploaded DecreaseUploaders() is called in the OnClientFileUploaded event. For your reference I'm attaching small sample.

    Regarding your second question uploading could be delayed as you call GetUploaders() in every few seconds and don't permit uploading until there are less than 10 uploading users.

    Kind regards,
    Hristo Valyavicharski
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017