Click to See Complete Forum and Search --> : Limit File Upload Amount Question (FileUp)


theflyingminst
03-23-2008, 07:09 PM
Hi, I was wondering if anyone might know the most commonly used method to reject someones upload if they reach a maximum set limit per folder. My hosts server uses SofArtisans FileUp.

Thanks much.

yamaharuss
03-23-2008, 09:00 PM
http://support.softartisans.com/kbview_318.aspx

theflyingminst
03-23-2008, 09:28 PM
Hey thanks for the link! I was actually thinking more in terms of some type of code that I could use to count by how many files; say I wanted to only allow 12 downloads per person without that depending on file size, so each folder could only hold 12 files..

yamaharuss
03-24-2008, 01:13 AM
You can count the number of files in a directory using FSO.

set fs=Server.CreateObject("Scripting.FileSystemObject")
set foldername=fs.GetFolder(server.mappath("uploads\"))

if foldername.files.count < 12 then
' put your upload code here
else
response.write "Sorry, only 12 allowed."
end if

set foldername=nothing
set fs=nothing

theflyingminst
03-24-2008, 01:31 AM
Sweet deal! Thanks so much!