Link to home
Start Free TrialLog in
Avatar of ranirajesh
ranirajesh

asked on

How to find the size of the PDF Dynamically

Hi

I have an asp page with links to lots of pdfs from a different folder with the size of the pdf mentioned  along with the link. I keep updating the pdfs in the folder. Is there a way to write a code , so that each time I update the pdf in the folder the size also changes accordingly in the asp page. Right now everytime I have to modify the asp page as well.

Please help ...

Thanks

Rani
SOLUTION
Avatar of vipero
vipero

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\")

for each x in fo.files
  'Print the name and size of all files in the test folder
  Response.write(x.Name & " (" & CLng(x.Size / 1024) & "kb) <br />")
next

set fo=nothing
set fs=nothing
Avatar of ranirajesh
ranirajesh

ASKER

Thanks guys this does work, but I have to display the pdf size in front of the individual links . The links are randomly placed in the asp file.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot guys for you help on this one !