get filesize using javascript

Discussion in 'Javascript' started by trapman, Apr 19, 2006.

  1. trapman

    trapman Guest

    I there!

    I would like to know if there is anyway to get the filesize of one
    particular file in the local filesystem.
    I heard about a solution using ActiveX but obviously it only works in
    IE.

    Thnks a lot ,

    Sérgio Silva
     
    trapman, Apr 19, 2006
    #1
    1. Advertisements

  2. trapman

    Randy Webb Guest

    trapman said the following on 4/19/2006 4:21 PM:
    > I there!
    >
    > I would like to know if there is anyway to get the filesize of one
    > particular file in the local filesystem.


    No.

    > I heard about a solution using ActiveX but obviously it only works in
    > IE.


    More specifically, IE for Windows, and then it only "works" if the user
    allows full access to the File System.

    Otherwise, ask the user:

    var fileSize = prompt('What size is file ABC.EFG?','FileSize');

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Apr 19, 2006
    #2
    1. Advertisements

  3. trapman

    trapman Guest

    Well asking the user isn't an option.

    Even with IE 6 i need to have the server url on the trusted sites. I
    believe that the default internet zone is actually not allowing
    creation of ActiveX objects :/

    Thnks a lot though!
     
    trapman, Apr 19, 2006
    #3
  4. trapman

    Randy Webb Guest

    trapman said the following on 4/19/2006 4:40 PM:
    > Well asking the user isn't an option.


    Why? Is it some file the user wouldn't want you looking at?

    > Even with IE 6 i need to have the server url on the trusted sites.


    Ummm, ok.


    > I believe that the default internet zone is actually not allowing
    > creation of ActiveX objects :/


    No, it doesn't. It prompts for the use of ActiveX

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Apr 19, 2006
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen

    Format filesize in kB or MB

    Arjen, Aug 8, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,391
    Jerry III
    Aug 9, 2003
  2. David Colliver

    Problem retrieving filesize

    David Colliver, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    476
    David Colliver
    May 17, 2005
  3. =?Utf-8?B?ZG90bmV0dGVzdGVy?=

    Response.writefile (filename) ?? problem with filesize

    =?Utf-8?B?ZG90bmV0dGVzdGVy?=, Aug 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    604
    Buddy Ackerman
    Aug 16, 2005
  4. VB Programmer

    How check filesize using FileUpload control?

    VB Programmer, Jan 18, 2006, in forum: ASP .Net
    Replies:
    11
    Views:
    20,907
  5. Michel Rosien

    STL Stream maximum filesize?

    Michel Rosien, Sep 18, 2003, in forum: C++
    Replies:
    8
    Views:
    805
    Mike Wahler
    Sep 18, 2003
  6. Rainer Goerke

    filesize of an ofstream

    Rainer Goerke, May 7, 2004, in forum: C++
    Replies:
    6
    Views:
    10,290
    Mike Wahler
    May 9, 2004
  7. Alan Howard
    Replies:
    2
    Views:
    552
    Alan Howard
    Jun 20, 2004
  8. linbox
    Replies:
    0
    Views:
    248
    linbox
    Jan 20, 2007
Loading...