Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Proeders file attachment - different upload sizes

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Webbo Posted - 03 December 2008 : 18:01:40
Has anyone had a go at setting different upload size limits for different user levels?

ie if mLev = 1 then allow such and such a size

and if mLev =>2 then allow a different size

?
<
2   L A T E S T    R E P L I E S    (Newest First)
Webbo Posted - 04 December 2008 : 09:10:02
I'm using 'proeder's file attachment V1.2'

The part that checks the file sizes is:

'##### check max file size

   strSQL = "SELECT UPLOAD_VALUE FROM " & strTablePrefix & "UPSIZE WHERE UPLOAD_VAR = 'STRUPLOADFILESIZE'"
   set rsSize = my_Conn.Execute (strSQL)
   strAllowedSize = rsSize("UPLOAD_VALUE")

      if bytecount < strAllowedSize then
         AllowSize = true
      else
         AllowSize = false
      end if

   rsSize.close
   set rsSize = nothing

   If strAllowedSize < 1024 Then
         strAllowedSize = Round(strAllowedSize,2) & " Bytes"
   ElseIf strAllowedSize < 1048576 Then
         strAllowedSize = Round(strAllowedSize/1024,2) & " KB"
   Else
         strAllowedSize = Round(strAllowedSize/1048576,2) & " MB"
   End If


and I'd be looking to either use the sLev = from the sponsors mod but would have to add in some code to the inc_header_short.asp file so that sLev is recognised, or maybe looking at allowing increased upload limits for certain groups from the Usergroups mod<
Carefree Posted - 03 December 2008 : 22:14:06
No, but shouldn't be too difficult. Which program are you using to upload?

Assuming you want the file sizes to be in number of bytes, you could use a routine as below. You would only need two lines of type. Set your starting variable value (number of MB desired * 1024) - example is for 2 MB.

Then choose whether you want each user level's ratio to the starting variable to be a constant (as in the middle line), or to increase by a bigger percentage for each level (as in the final line - which squares the mLev before multiplying it by 2 MB.


'	######### Size Allowances Per MLev ########

'	Starting value of	 2 MB
	intLvl=2048

'	Max size would be  8 MB	
	allowedsize=intLvl*mLev

'	Max size would be 32 MB
	allowedsize=intLvl*(mLev^2)

'	######### Size Allowances Per MLev ########
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07