size and extension

Discussion in 'C#' started by FlashO, Mar 26, 2008.

  1. #1
    Hi¡
    He wanted know how display by the screen the size and extension of a file that is already stored on my server.
    Thanx
     
    FlashO, Mar 26, 2008 IP
  2. tacosalad

    tacosalad Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You would want to use the FileSystemObject:

    Set fs=Server.CreateObject("Scripting.FileSystemObject")

    filepath = server.mappath("babble.txt")

    Response.Write("The file extension of the file babble is: ")
    Response.Write(fs.GetExtensionName(filepath))
    Response.Write("<br>")

    set fsofile = fs.getfile(filepath)
    Response.Write("The file size of the file babble is: ")
    Response.Write(fsofile.size & " bytes")

    set fsofile = nothing
    set fs = nothing
     
    tacosalad, Mar 26, 2008 IP
  3. FlashO

    FlashO Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you so much, is what I needed, but I have another doubt...
    I need to create a folder in my ftp from the browser with code asp.
    There are some code asp, which enter my username and password from my ftp, I can do this?
    Thanks again
     
    FlashO, Mar 27, 2008 IP