need some help

Discussion in 'PHP' started by cavendano, Sep 5, 2007.

  1. #1
    well I need php to get filesize from a file in a different directory.

    <?php
    $root = dirname(__FILE__);
    $root_url = "http://mobilereelz.com/tones";
    $sname = "0Sre4dwn4";
    $dir_url_mp4 = $root.'/temp/'.$sname.'.m4a';
    $get_size_mp4 = filesize("0Sre4dwn4.m4a");
    $url_mp4 = $root_url."/temp/".$sname.".m4a";
    $dir_test_mp4 = '/temp/'.$sname.'.m4a';
    $dir_test = '/local/home/cavendan/mobilereelz.com/tones/temp/'.$sname.'.m4a';
    
    echo $dir_url_mp4;
    echo $url_mp4;
    echo $dir_test_mp4;
    echo $get_size_mp4;
    
    ?>
    PHP:
    As you can see alot of the variables are the same I was just playing around with them to find out which would work.
    $get_size_mp4 = filesize("0Sre4dwn4.m4a");
    works right now but only if I put this php file in the same folder...I need filesize to tell me the filesize but from a file in a different folder. I tried:
    $get_size_mp4 = filesize("temp/0Sre4dwn4.m4a");
    and that doesnt work

    any help is appreciated
     
    cavendano, Sep 5, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    It does work, you probably put either the path wrong, or the filename (which is case-sensitive on UNIX systems).

    When you used this:
    
    $get_size_mp4 = filesize("temp/0Sre4dwn4.m4a");
    
    PHP:
    Are you sure the path was temp/0Sre4dwn4.m4a or was it maybe: /temp/0Sre4dwn4.m4a (with a leading slash) ?
     
    nico_swd, Sep 6, 2007 IP
  3. cavendano

    cavendano Well-Known Member

    Messages:
    360
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #3
    your a genius! that worked...you'd be surprised how either people ignored my question or couldnt answer it themselves
     
    cavendano, Sep 6, 2007 IP