limiting uploads by currecnt dir size?

Results 1 to 2 of 2

Thread: limiting uploads by currecnt dir size?

  1. #1
    Join Date
    Dec 1969

    Default limiting uploads by currecnt dir size?

    hello,<BR>i&#039;m trying to use this script to get the total size of a directory and then limit uploads depending on the current size.<BR>here&#039;s what i&#039;ve got so far:<BR>&#060;%<BR>&#039;--Function for MB<BR>Function bytesToMegs(number)<BR>dim bytes, megs<BR>bytes = number<BR>megs = bytes / 1000000<BR>megs = Round(megs,1)<BR>bytesToMegs = megs<BR>End Function<BR>&#039;-----------<BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>tpath = Server.mapPath("/members/By-Code/")<BR>Set objFolder = objFSO.GetFolder(tpath)&#039;tpath is the path to your folder<BR><BR>iFolderSize = objFolder.Size<BR>iFolderSize = bytesToMegs(iFolderSize)<BR><BR>response.write iFolderSize&"mb<BR><BR>"<BR><BR>if iFolderSize &#062; "10" then<BR>response.write "File Quota Limit Reached"<BR>else<BR>response.write "you may upload more files"<BR><BR>now i&#039;m trying to limit uploads to 10mb&#039;s,<BR>right now the dir is 10.6 mb but the script still doesn&#039;t show: <BR>response.write "File Quota Limit Reached"<BR><BR>what am i doing wrong here? and how i can i fix it?<BR><BR>thanks in advance for your time!

  2. #2
    Join Date
    Dec 1969

    Default Folder size is not a string

    try:<BR>if iFolderSize &#062; 10 then<BR>blah<BR>else<BR>blah<BR>end if<BR><BR>Note there are NO quites around the 10<BR><BR>-- whol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts