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. Advertising

  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. Advertising

  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. Advertising

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,128
    Jerry III
    Aug 9, 2003
  2. David Colliver

    Problem retrieving filesize

    David Colliver, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    David Colliver
    May 17, 2005
  3. VB Programmer

    How check filesize using FileUpload control?

    VB Programmer, Jan 18, 2006, in forum: ASP .Net
    Replies:
    11
    Views:
    20,374
  4. Alan Howard
    Replies:
    2
    Views:
    286
    Alan Howard
    Jun 20, 2004
  5. linbox
    Replies:
    0
    Views:
    113
    linbox
    Jan 20, 2007
Loading...

Share This Page