wav file duration in php
===

I need to get the wav file duration in php i know there are  lots of code available for the same . i have used this one.

    function wavDur($file) {
    $fp = fopen($file, 'r');
    if (fread($fp,4) == "RIFF") {
    fseek($fp, 20);
    $rawheader = fread($fp, 16);
    $header = unpack('vtype/vchannels/Vsamplerate/Vbytespersec/valignment/vbits',$rawheader);
    $pos = ftell($fp);
    while (fread($fp,4) != "data" && !feof($fp)) {
    $pos++;
    fseek($fp,$pos);
    }
    $rawheader = fread($fp, 4);
    $data = unpack('Vdatasize',$rawheader);
    $sec = $data[datasize]/$header[bytespersec];
    $minutes = intval(($sec / 60) % 60);
    $seconds = intval($sec % 60);
    return str_pad($minutes,2,"0", STR_PAD_LEFT).":".str_pad($seconds,2,"0", STR_PAD_LEFT);
    }

but the problem is that i need the file path the file control doesnt allow me to get the full path i want to show the duration to the user before uploading just when the user have selected the file is this possible .