Click here to Skip to main content
15,908,906 members
Home / Discussions / C#
   

C#

 
AnswerRe: Limiting Users Download Size Pin
Pete O'Hanlon28-Feb-12 21:35
mvePete O'Hanlon28-Feb-12 21:35 
You should really have asked this in the ASP.NET forum. Anyway, assuming that you only allow logged in users to download files, on every download request you would get the size of the specified file and see if adding it to the days total would take the user over the limit.

I know this seems obvious, but bear with me: the wrinkle you have is in defining what counts as a day - is it based on the last 24 hours activity, or is it based on an arbitrary point such as midnight on the database server. The reason you need to know this is because this will affect your calculation as to the previous day. Now, I would suggest storing the current server time in the database against each download for the user as it will make your calculations easier.

Further wrinkles for you to think about. What happens if the user aborts a download and then restarts it? Does this count towards your size limit? How are you going to handle the switch over when the clocks go forwards and backwards by an hour?

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Limiting Users Download Size Pin
Majid Shahabfar29-Feb-12 0:53
Majid Shahabfar29-Feb-12 0:53 
GeneralRe: Limiting Users Download Size Pin
Pete O'Hanlon29-Feb-12 0:58
mvePete O'Hanlon29-Feb-12 0:58 
GeneralRe: Limiting Users Download Size Pin
Majid Shahabfar29-Feb-12 8:41
Majid Shahabfar29-Feb-12 8:41 
GeneralRe: Limiting Users Download Size Pin
Pete O'Hanlon29-Feb-12 8:53
mvePete O'Hanlon29-Feb-12 8:53 
GeneralRe: Limiting Users Download Size Pin
Majid Shahabfar29-Feb-12 21:19
Majid Shahabfar29-Feb-12 21:19 
GeneralRe: Limiting Users Download Size Pin
Pete O'Hanlon29-Feb-12 21:50
mvePete O'Hanlon29-Feb-12 21:50 
AnswerRe: Limiting Users Download Size Pin
Pete O'Hanlon28-Feb-12 21:40
mvePete O'Hanlon28-Feb-12 21:40 
QuestionPush data from WCF to client Pin
nitin_ion28-Feb-12 17:43
nitin_ion28-Feb-12 17:43 
AnswerRe: Push data from WCF to client Pin
Abhinav S28-Feb-12 19:39
Abhinav S28-Feb-12 19:39 
AnswerRe: Push data from WCF to client Pin
BobJanova28-Feb-12 22:29
BobJanova28-Feb-12 22:29 
GeneralRe: Push data from WCF to client Pin
Pete O'Hanlon28-Feb-12 23:27
mvePete O'Hanlon28-Feb-12 23:27 
GeneralRe: Push data from WCF to client Pin
BobJanova29-Feb-12 1:55
BobJanova29-Feb-12 1:55 
GeneralRe: Push data from WCF to client Pin
Pete O'Hanlon29-Feb-12 2:02
mvePete O'Hanlon29-Feb-12 2:02 
AnswerRe: Push data from WCF to client Pin
PIEBALDconsult29-Feb-12 2:41
mvePIEBALDconsult29-Feb-12 2:41 
GeneralRe: Push data from WCF to client Pin
jschell29-Feb-12 11:47
jschell29-Feb-12 11:47 
GeneralRe: Push data from WCF to client Pin
BobJanova1-Mar-12 1:47
BobJanova1-Mar-12 1:47 
GeneralRe: Push data from WCF to client Pin
jschell1-Mar-12 8:43
jschell1-Mar-12 8:43 
QuestionC# programme crashes without an obvious reason Pin
Ash Zidan28-Feb-12 6:16
Ash Zidan28-Feb-12 6:16 
QuestionRe: C# programme crashes without an obvious reason PinPopular
Eddy Vluggen28-Feb-12 9:13
professionalEddy Vluggen28-Feb-12 9:13 
AnswerRe: C# programme crashes without an obvious reason Pin
Shameel28-Feb-12 18:32
professionalShameel28-Feb-12 18:32 
GeneralRe: C# programme crashes without an obvious reason Pin
Eddy Vluggen28-Feb-12 20:27
professionalEddy Vluggen28-Feb-12 20:27 
GeneralRe: C# programme crashes without an obvious reason Pin
Pete O'Hanlon28-Feb-12 21:29
mvePete O'Hanlon28-Feb-12 21:29 
GeneralRe: C# programme crashes without an obvious reason Pin
Shameel28-Feb-12 23:10
professionalShameel28-Feb-12 23:10 
GeneralRe: C# programme crashes without an obvious reason Pin
Pete O'Hanlon28-Feb-12 23:22
mvePete O'Hanlon28-Feb-12 23:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.