Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 12-29-2005, 07:06 AM File Size
Experienced Talker

Posts: 38
Trades: 0
I have been adding the file size for my downloads into a Access database but i have around 1000 videos and so writing the file size in each time and get a bit much. I was just wandering if anyone knew an easier way? or if there is a way i can read the file size from my web server? thanks for any help
phreakyphonez is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-29-2005, 09:30 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you could use the FSO (File System Object)
Code:
function getFileSize(filename)
dim objFSO,movFile
Set objFSO= CreateObject("Scripting.FileSystemObject") 
Set movFile= objFSO.GetFile(server.mappath(filename))
getFileSize= movFile.size
set movFile = nothing
set objFSO = nothing
end function
filename should include the relative path to the file as well
so;
Code:
MovieName = "armageddon.avi"
MoviePath = "/movies/a/"
FileSize = getFileSize(MoviePath & MovieName)
strSQL = "UPDATE table SET sizefield = " & FileSize & " WHERE namefield = " & MovieName & " ;"
you could also set this into a loop to run through each file in any given folder
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2006, 08:09 AM
Experienced Talker

Posts: 38
Trades: 0
Worked a treat, thanks
phreakyphonez is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to File Size
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21403 seconds with 12 queries