Update file.php

This is the implementation described in the bugtracker
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=11410&tracker_item_id=29826

This is an issue in Joomla 2.5, 3.0 and 3.1