set file extension depending on drupal input format