Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Proeders file attachment - different upload sizes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 03 December 2008 :  18:01:40  Show Profile  Visit Webbo's Homepage  Reply with Quote
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

?
<

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 03 December 2008 :  22:14:06  Show Profile  Reply with Quote
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 ########
<

Edited by - Carefree on 03 December 2008 22:16:19
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 04 December 2008 :  09:10:02  Show Profile  Visit Webbo's Homepage  Reply with Quote
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<
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07