Q:

Remove "Edit" and "Delete from files" from SilverStripe UploadField

Via Silverstripe 3.2 I am using an UploadField in a frontend form and it is working fine and looking pretty good:

However I would like to remove the unneeded "Edit" and "Delete from files" actions from the uploaded file. 
Here is the UploadField initialisation code I am using:
// upload field
$uploadField = new UploadField('File', 'Upload File');
$uploadField->setCanAttachExisting(false);
$uploadField->setCanPreviewFolder(false);
$uploadField->relationAutoSetting = false;
$uploadField->setAllowedMaxFileNumber(1);

Is there a configuration option I'm missing or should I just use CSS to hide the buttons? 

A:

Here's how I solved a similar issue in the past:
// prevent showing preview folder
$uploadField->setConfig('canPreviewFolder', false);
// use a custom button-template with only the wanted buttons      
$uploadField->setTemplateFileButtons('UploadField_FrontendButtons');

The template UploadField_FrontendButtons.ss could look like this :
<button class="ss-uploadfield-item-remove ss-ui-button ui-corner-all" title="<% _t('UploadField. REMOVEINFO', 'Remove this file from here, but do not delete it from the file store') %>" data-icon="plug-disconnect-prohibition">
<% _t('UploadField. REMOVE', 'Remove') %></button>

The template above is just a stripped down version of framework/templates/Includes/UploadField_FileButtons.ss

