Skip to main content Help Control Panel

Login   A+   A-

Community «   Discussion forum «   Bug tracker «  

Limits onUser Uploads

Yarber Evan -- on Dec. 26 2006, from Western NC USA
Professional Screw Up
I have been running YACS for about a week now on a localhost server. I have been monkeying around with the configuration and layout. I intend to set it up on a public server, in a few weeks, as a private community for musicians. I would like to limit both the allowed file size and total amount users can upload to the server. Is this possible, or perhaps planned for future releases? Restrictions on diskspace and bandwidth , dictate that I excercise some control over file uploads.

I would also like to praise all the folks who have helped develop this wonderful community system. It is making it possible for me to bring musicians, from all over the world, together to collaborate with one another. Without YACS, I'm not sure that I could accomplish this.

Many Many Thanks
Evan
Bernard
avatar
from nearby-an-airport
Associate, 6798 posts

on Dec. 27 2006


At the moment, the limit for uploads is set only at the file level, and is dictated by PHP settings. However, on any upload you will receive a message to police abuse where necessary.

In the future it would make sense to introduce a global limit to member uploads, including files and images. I will add this to the to do list, for a next release. Thank you very much for your interest in YACS.
UncleJam
from Western NC USA
2 posts

on Dec. 27 2006


Thanks for the reply. As a private community, with limited membership, I don't forsee any problems.

It is good to see someone doing something good for the world, just because....
Bernard
avatar
from nearby-an-airport
Associate, 6798 posts

inspired from UncleJam on Dec. 27 2006


UncleJam: Actually, there are two ways to limit uploads.

The first one is to define a limit in the user profile, to count uploaded bytes, and to stop accepting files above the limit. We could name this "the boundary approach". Another way would be to set an allowed number of bytes in the user profile, to decrease it on each upload, and to stop at zero. This would be "the bucket approach".

Why bother, if both provides the same feature? In my opinion, "the bucket approach" could be easier to understand and to manage. What do you think?
NickR
avatar
from West Yorkshire, UK
337 posts

inspired from Bernard on Dec. 28 2006


" UncleJam: Actually, there are two ways to limit uploads.

The first one is to define a limit in the user profile, to count uploaded bytes, and to stop accepting files above the limit. We could name this "the boundary approach". Another way would be to set an allowed number of bytes in the user profile, to decrease it on each upload, and to stop at zero. This would be "the bucket approach".

Why bother, if both provides the same feature? In my opinion, "the bucket approach" could be easier to understand and to manage. What do you think? "


I would take the boundary approach. If you decide to up the user limit, there are no recalculations to the user account required.

With the bucket approach, you would have to loop through every user account and add to the bucket by the new upload allowance. If you fail to do this, then only new users will get the new allowance.

Nick.
Bernard
avatar
from nearby-an-airport
Associate, 6798 posts

inspired from NickR on Dec. 28 2006


NickR: In both situations a simple SQL UPDATE would do the job for all members at once...
NickR
avatar
from West Yorkshire, UK
337 posts

inspired from Bernard on Dec. 28 2006


" NickR: In both situations a simple SQL UPDATE would do the job for all members at once...

"


I would of thought it not a simple update.

User a has used 4 megs of 5

User b has used 3 megs of 5

Using the boundary is it simple as adding X to 5 in one place.

User a has 1 meg left User b has 2 meg left

Using the bucket you would have to modify each db record by adding X which is a bigger overhead...

Correct me if I am mistaken though.

As this is not likely to be a often used feature (changing the upload limit), the overhead probably does not matter.

Which would be better to implement from a downloading point of view (eg changing the db record as files are downloaded)?

Finally...

One thing to consider, how do you count the same file being downloaded multiple times... does it add to your quota, or do you ignore, as if the download fails or you click the link twice you could be unfairly penalised ?

Nick
Bernard
avatar
from nearby-an-airport
Associate, 6798 posts

inspired from NickR on Dec. 29 2006


NickR: with the boundary approach (set a new maximum to 5M) the statement looks like the following

UPDATE ... SET upload_allowance = 5

and with the bucket approach (give 2M more to everybody) it is quite so easy:

UPDATE ... SET upload_allowance = upload_allowance+2

Of course, the upload allowance would be impacted only on actual transfer, to avoid duplicates, etc.

Rate this page
Posted by UncleJam on Dec. 26 2006, edited by Bernard on Dec. 26 2006, (popular)