This is a migrated thread and some comments may be shown as answers.

How to count and control concurrent uploading users?

4 Answers 84 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
X
Top achievements
Rank 1
X asked on 05 Apr 2013, 03:18 AM
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?

4 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 09 Apr 2013, 03:55 PM
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.
0
X
Top achievements
Rank 1
answered on 10 Apr 2013, 07:58 AM
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). 
0
Hristo Valyavicharski
Telerik team
answered on 15 Apr 2013, 11:58 AM
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.
0
Hristo Valyavicharski
Telerik team
answered on 15 Apr 2013, 12:57 PM
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.
Tags
AsyncUpload
Asked by
X
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
X
Top achievements
Rank 1
Share this question
or