grab attributes from elements['file'].
improve legibility.