UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Script To Check Size Of File    
 
   
AvgJoe
post Feb 10 2011, 12:17 PM
Post #1

UtterAccess Ruler
Posts: 2,042
From: West Coast, USA



Greetings. We're scanning documents into our system and we're finding out that certain scan jobs (docs with excessive shading, graphics, etc) are "killing" the system ("the snake doesn't know that it's trying to eat an elephant"). We can set file size limitations on every scanner except one, however, we can re-direct the input from this scanner to a different folder.

What I'm interested in is a script that will look at the size of the file in the folder. If the size of the file is <30MB, I'd like to move (or copy) that file to the "production folder." I guess the catch would be if the script could have some kind of timer or other "activator" that will allow it to only check the folder if a file has been scanned into the folder.

Any assistance is greatly appreciated.

TIA,

AvgJoe
Go to the top of the page
 
+
Roger_Carlson
post Feb 10 2011, 12:54 PM
Post #2

UtterAccess VIP
Posts: 2,331
From: West Michigan



It's been a loooonnnnngggg time since I've done this, but you can use the FileSystemObject to find the file size. Something like this:

dim fso, zipfile, zipfilesize
set fso = server.CreateObject("Scripting.FileSystemObject")
set zipfile = fso.GetFile(server.mapPath(".")& "/Myfile.txt")
zipfilesize=cint(zipfile.size/1024)

This, of course, only finds the file size. What you do with it is up to you. I've forgotten most of the ASP I ever knew.
Go to the top of the page
 
+
AvgJoe
post Feb 10 2011, 01:05 PM
Post #3

UtterAccess Ruler
Posts: 2,042
From: West Coast, USA



Roger,

Thanx for the reply. You're right - it's easily several lifetime and/or light years since I've been anywhere near something like this.


AvgJoe
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 05:25 AM