get file size without activex using javascript

Discussion in 'JavaScript' started by ade_ari_w0, Aug 8, 2007.

  1. #1
    how to get file size using javascript without activeX coz this is for linux

    Thnx
     
    ade_ari_w0, Aug 8, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Not possible. And this ActiveX you're talking will work only on a very few browsers.
     
    nico_swd, Aug 9, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Kudos on understanding what he meant :D

    ade_ari, are you talking about the file size a user selects in an "upload file" form or the file size of an arbitrary file on their computer. The former can be done by uploading the file to your server's temp directory and using filesize()
     
    krt, Aug 9, 2007 IP
  4. sharry

    sharry Peon

    Messages:
    319
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes u can use ajax to accomplish this.. call a php script which returns the filesize, and load the echoed result into a div
     
    sharry, Aug 20, 2007 IP
  5. Wildhoney

    Wildhoney Active Member

    Messages:
    192
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #5
    PHP can do this because it is server-side, but if you remember, Javascript is client-side and thus getting the file-size of a file on an external server would require communication to an external server. Thus as aforementioned, AJAX is the way to accomplish this.
     
    Wildhoney, Aug 20, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    As far as I understood, he wants to get the size of a local file. But something's telling me he won't come back anyway. =p
     
    nico_swd, Aug 21, 2007 IP