Author |
Topic |
Desmomax
New Member
55 Posts |
Posted - 15 February 2007 : 11:21:52
|
I'd like to do not set a limit for my moderators. How can i change the code to do this? i tried to change : IF ds.Size + bytecount > maxDiskSpace then
in
IF ds.Size + bytecount > maxDiskSpace and mlev <2 then
but doesnt work...
< |
Il forum |
|
|
Desmomax
New Member
55 Posts |
Posted - 16 February 2007 : 05:00:06
|
quote: Originally posted by PPSSWeb
You might also want to let the users know how much disk space they have used of their quota in the myfiles page.
Insert at line#222 the following:
'#################display current disk usage################
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
Dim ds
Set ds=ScriptObject.GetFolder(Path)
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize-2 & """><b>Current Disk Usage = " & Round(ds.Size/1048576,2) & " MB"
IF AdminAllowed=false then
Response.Write " of "& maxDiskSpace/1048576 & " MB</b></font></p><p>"
Else
Response.Write "</b></font></p><p>"
End IF
set ds=nothing
'###########################################################
Hallo,
i tried to test the code with a username i created.
This directory doesnt exist in upload folder (No files uploaded by this user) then if i click on MY FILES i receive the following error:
Files nella tua directory di upload...
Errore di run-time di Microsoft VBScript error '800a004c'
Impossibile trovare il percorso (path not found)
/myforum/myfiles.asp, line 225
Line 225 is the one you suggest me: Set ds=ScriptObject.GetFolder(Path)
Do you know how to fix it?
many thanx
< |
Il forum |
Edited by - Desmomax on 16 February 2007 05:04:01 |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 16 February 2007 : 11:22:31
|
quote: Originally posted by thermal_seeker
would you like to share your piece of code??
would I have to make extra usergroups (ie file upload, file upload2, file upload3 etc?)
EDIT: thinking about this a bit more.. I have set the max upload size to 20MB. Once a user gets to that amount surely all I would have to do is allow them to usergroup fileupload2 for a further 20MB?? and so on...or am I missing something?? I presume that I would also have to add another line to post.asp
if ((mlev > 3) or InArray(strGroupMembership, intFileUpload2Allowed)) then ' check that user is either administrator of member of upload2 usergroup and in config.asp
const intFileUpload2Allowed = <integer value of group>
Dave
thermal_seeker,
Sorry for the delayed response. We have not had power for days here. Still working the bugs out of getting it to work with usergroups (myfiles works fine, outputFile does not yet). I will post the solutions when/IF I get it working.
< |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 16 February 2007 : 11:24:15
|
quote: Originally posted by Desmomax
it works!!! Great!!! :)
i have only a little error:
when i try to upload a file too big then i receive the error message , when i click to COME BACK on the pop up windows i receive this error:
Errore di run-time di Microsoft VBScript error '800a0005'
Chiamata di routine o argomento non validi: 'MidB'
/myforum/upload.asp, line 5
The line is: boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
any idea?
I have seen this before, but not consistently. If I refresh the page the error is usually gone. I have never had a user encounter it either, so I am not sure the cause. Does it happen consistently and is repreducable for you?< |
Edited by - PPSSWeb on 16 February 2007 11:25:11 |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 16 February 2007 : 11:31:59
|
quote: Originally posted by Desmomax
quote: Originally posted by PPSSWeb
You might also want to let the users know how much disk space they have used of their quota in the myfiles page.
Insert at line#222 the following:
'#################display current disk usage################
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
Dim ds
Set ds=ScriptObject.GetFolder(Path)
Response.Write "<p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize-2 & """><b>Current Disk Usage = " & Round(ds.Size/1048576,2) & " MB"
IF AdminAllowed=false then
Response.Write " of "& maxDiskSpace/1048576 & " MB</b></font></p><p>"
Else
Response.Write "</b></font></p><p>"
End IF
set ds=nothing
'###########################################################
Hallo,
i tried to test the code with a username i created.
This directory doesnt exist in upload folder (No files uploaded by this user) then if i click on MY FILES i receive the following error:
Files nella tua directory di upload...
Errore di run-time di Microsoft VBScript error '800a004c'
Impossibile trovare il percorso (path not found)
/myforum/myfiles.asp, line 225
Line 225 is the one you suggest me: Set ds=ScriptObject.GetFolder(Path)
Do you know how to fix it?
many thanx
Right,
Good catch, we need to check that the folder exists before we start getting the details from it. change that piece of code to the following.
Try putting this:
IF ScriptObject.FolderExists(Path) THEN before the dim ds and close the if by putting End IF after the set ds=nothing
Let me know if that clears it up. If so we should rework it so it fits into the IF statement below which performs the same check.< |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 16 February 2007 : 14:37:31
|
|
Edited by - PPSSWeb on 19 February 2007 13:57:56 |
|
|
Desmomax
New Member
55 Posts |
Posted - 19 February 2007 : 04:15:18
|
quote: Originally posted by PPSSWeb Right,
Good catch, we need to check that the folder exists before we start getting the details from it. change that piece of code to the following.
Try putting this:
IF ScriptObject.FolderExists(Path) THEN before the dim ds and close the if by putting End IF after the set ds=nothing
Let me know if that clears it up. If so we should rework it so it fits into the IF statement below which performs the same check.
Many thanx!!! now it works!! < |
Il forum |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 19 February 2007 : 09:19:22
|
quote: Originally posted by Desmomax
Many thanx!!! now it works!!
Did you try the most recent version of the code? I would like to have someone test it to make sure I didn't forget anything.
Thanks, Steve< |
|
|
Desmomax
New Member
55 Posts |
Posted - 19 February 2007 : 10:40:34
|
quote: Originally posted by PPSSWeb
quote: Originally posted by Desmomax
Many thanx!!! now it works!!
Did you try the most recent version of the code? I would like to have someone test it to make sure I didn't forget anything.
Thanks, Steve
i tried this:
quote: Right,
Good catch, we need to check that the folder exists before we start getting the details from it. change that piece of code to the following.
Try putting this:
IF ScriptObject.FolderExists(Path) THEN
before the dim ds and close the if by putting
End IF
after the set ds=nothing
Let me know if that clears it up. If so we should rework it so it fits into the IF statement below which performs the same check.
< |
Il forum |
|
|
Desmomax
New Member
55 Posts |
Posted - 20 February 2007 : 05:37:09
|
Thanks PPSSWeb but i dont have usergroup mod installed and i am not interested..
is it possibile to do not check the space used only by MODERATORS and ADMIN ?
how i have to modify your code to do this? many thanx < |
Il forum |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 20 February 2007 : 10:42:15
|
quote: Originally posted by Desmomax
Thanks PPSSWeb but i dont have usergroup mod installed and i am not interested..
I threw together this version that does not use usergroups, but is just a quota as you wanted. It is basically the same as my last posting in this topic, but withouth the usergroups parts. A little cleaner than my first shot that you helped debug.
quote: Originally posted by Desmomax
is it possibile to do not check the space used only by MODERATORS and ADMIN ?
how i have to modify your code to do this? many thanx
I am not sure I understand correctly, but I think you are asking to perform quota check on normal members only and not admins or moderators.
To do so, you would have to check their member level and only run the quota check if mlev > 2.
First you would have to get mlev over to the right spot to check it.
In pop_upload_new.asp change line #119 to:
Response.Write " <input type=""hidden"" name=""memberName"" value=""" & strDBNTUserName & """><input type=""hidden"" name=""memberID"" value=""" & MemberID & """><input type=""hidden"" name=""mLev"" value=""" & mLev & """>" & vbNewline & _
Then use it in outputFile.asp to check about using the quota. At line#75 insert:mLev = UploadRequest.Item("mLev").Item("Value")
Then before the "Dim ds" insert:
IF (mLev < 3)
and after the "set ds=nothing" insert:
End If
Also, you may want to do the same in myfiles.asp to have it not display a limit there. < |
|
|
Desmomax
New Member
55 Posts |
Posted - 20 February 2007 : 13:16:17
|
yes, you are right... i'd like to perform quota check only on normal users.
I tried to insert the code you suggest but something is wrong.. i am not sure about the right position for the code in outputfile.asp as i have at line 75 comments lines.
Here is mine outputfile.asp , could you please take a look?
Download Outputfile
after that, sure, i need to change also myfiles.asp...
really appreciate your help < |
Il forum |
Edited by - Desmomax on 20 February 2007 13:17:20 |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 20 February 2007 : 15:08:22
|
quote: Originally posted by Desmomax
yes, you are right... i'd like to perform quota check only on normal users.
I tried to insert the code you suggest but something is wrong.. i am not sure about the right position for the code in outputfile.asp as i have at line 75 comments lines.
Here is mine outputfile.asp , could you please take a look?
Sorry, I forgot you were using a modified version. Instead of line #75, you should insert at line #124
Download Outputfile
quote: Originally posted by Desmomax
after that, sure, i need to change also myfiles.asp...
really appreciate your help
Yep, just do the same. Wrap the code for the quotas in the same "IF - End If". I am not sure which version you have running from the above, I can't tell you exactly where to put.< |
|
|
Desmomax
New Member
55 Posts |
Posted - 21 February 2007 : 18:04:55
|
I followed your instructions but after that if i try to upload a file after selected the file i receive a blank window and nothing come...
here is how i changed my outputfile.asp and pop_upload_new.aso, could you take a look?
Download file RAR of my asp
many thanx
< |
Il forum |
Edited by - Desmomax on 21 February 2007 18:05:41 |
|
|
PPSSWeb
Junior Member
312 Posts |
Posted - 22 February 2007 : 09:12:07
|
Your pop_upload_new.asp looks good, so it should be passing the mLev over to outputFile.asp
Check that your mLev is getting to the outputFile.asp correctly. Insert Response.Write "Member level: " & mLev & vbNewLine
into the code before the test for mLev<3 to make sure it has the correct value.< |
|
|
Topic |
|