Results 1 to 4 of 4

Thread: Filesize in ASP

  1. #1

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353

    Filesize in ASP

    I have the file path of a file, and now want to find out the size of this file. Is there anyway that I can do this in ASP?
    ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.

    Richard Whitehouse.
    Join the Footie Predictions League


    "Make it idiot proof and someone will make a better idiot."

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    You could write a COM DLL in VB you could call from ASP to get the info. Look into the FindFirstFile API call and the WIN32_FIND_DATA structure.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3
    Hyperactive Member
    Join Date
    Apr 2001
    Posts
    315
    Code:
    Dim fs
    Dim f
    Dim vSize
    Set fs = Server.CreateObject("Scripting.FileSystemObject")
    if fs.FileExists(strFileName) then
        set f = fs.GetFile(strFileName)
        vSize = f.size
    else
         ........
    End if
    Set f = Nothing
    Set fs = nothing

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Um, or you could do it the easy way...
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width