Basic attachment download function.

This commit is contained in:
James Cole
2015-07-18 21:32:31 +02:00
parent 359fab315f
commit cc1af60cb4
6 changed files with 115 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ class AttachmentHelper implements AttachmentHelperInterface
// move to config:
protected $maxUploadSize = 1048576; // 1MB per file
protected $allowedMimes = ['image/png','image/jpeg','application/pdf'];
protected $allowedMimes = ['image/png', 'image/jpeg', 'application/pdf'];
public $errors;
public $messages;
@@ -34,6 +34,18 @@ class AttachmentHelper implements AttachmentHelperInterface
$this->messages = new MessageBag;
}
/**
* @param Attachment $attachment
*
* @return mixed
*/
public function getAttachmentLocation(Attachment $attachment)
{
$path = storage_path('upload') . DIRECTORY_SEPARATOR . 'at-' . $attachment->id . '.data';
return $path;
}
/**
* @param Model $model
*