diff --git a/code/submissions/SubmittedFileField.php b/code/submissions/SubmittedFileField.php
index ca577f7..dbec4e2 100755
--- a/code/submissions/SubmittedFileField.php
+++ b/code/submissions/SubmittedFileField.php
@@ -17,7 +17,8 @@ class SubmittedFileField extends SubmittedFormField {
* @return String
*/
function getFormattedValue() {
- return ''. _t('SubmittedFileField.DOWNLOADFILE', 'Download File') .'';
+ $link = $this->getLink();
+ return (!empty($link)) ? ''. _t('SubmittedFileField.DOWNLOADFILE', 'Download File') .'' : '';
}
/**
@@ -26,6 +27,10 @@ class SubmittedFileField extends SubmittedFormField {
* @return String
*/
function getLink() {
- return ($this->UploadedFile()) ? $this->UploadedFile()->URL : "";
+ if ($this->UploadedFile()){
+ // Test if there is a filename, not only a filepath to the assets folder
+ return ($this->UploadedFile()->getFilename() != ASSETS_DIR.'/') ? $this->UploadedFile()->URL : '';
+ }
+ return '';
}
}
\ No newline at end of file