Results 1 to 5 of 5

Thread: size of file to download

  1. #1

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    Question size of file to download

    hello.
    i am sorry to have posted in this forum coz im not sure where to post my question..
    i am using jsp and i have a page that allows users to download excel/pdf/csv formatted files..problem is i need to display the file size of the file to be downloaded.(eg download (100KB) )..

    can anyone help me with this? or at least lead me to existings threads about this one...

    thanks a lot..

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: size of file to download

    I have moved your question to the XML, HTML, Javascript, Web and CGI forum.


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: size of file to download

    try this:
    Code:
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set fileObject = fso.GetFile(Server.MapPath("\fso\") & "\myfile.txt")
    
    Response.Write fileObject.Size & " bytes"
    PS: this probably should have been submitted in the Java or the XML, HTML, Javascript, Web and CGI section
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

  4. #4

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    Re: size of file to download

    hello there...thanks for moving my post..
    and thanks ALL for your suggestion.
    but im afraid am not familiar what language u were using..
    but really i do appreciate your time

    btw i this is the code i was looking for:

    Code:
           
          File genFile =  new File(filePath);
          long genLength = genFile.length();
    many thanks

  5. #5
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: size of file to download

    the language i was using was JSP
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

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