How to geht the full path of the image with wp_handle_upload_prefilter

Keywords´╝Ü php wordpress function

Question: 

I like to get the fullpath of the image, so that I can get the EXIF geodata from the image (function: get_image_location). I tried this How do I get the full path of an image ($featured_img_url = $file['name'].$file['tmp_name'];) but but this seems not to work because no lat/lng is extracted. It just shows the filename of the image without path(url) and file type.

Thanks for help,

Denis

############## Get file location of the uploaded file ################

function custom_upload_filter( $file ){

    $featured_img_url = $file['name'];

    // get geo location from EXIF iamge data
    $imgLocation = get_image_location( $featured_img_url );

    // latitude & longitude
    $imgLat = $imgLocation['latitude'];
    $imgLng = $imgLocation['longitude'];

    // set test file name
    $file['name'] = str_replace( ".", "", $imgLat ) .'-'. str_replace( ".", "", $imgLng ) .'-' . $file['name'];

    return $file;
}
add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' );

Answers: