You need to handle the file upload control change event. Its better to do that using jQuery on page load. For dependents fields to show there has to be a page postback which will not happen in case of file upload.
$(document).ready(function(){
$(".ext").closest("tr").hide();
$(".upload input").change(function(){
var fileName= $(this).val();
var extention= fileName.substr( (fileName.lastIndexOf('.') +1) );
if(extention)
{
$(".ext").closest("tr").show();
$(".ext").val(extention);
}
})
});
Here ext is the Extention field control CSS class and upload is file upload control CSS class which you can set at field advanced properties.