Skip to content

Commit 45a6abc

Browse files
authored
🚚 adding RememberedFile class
1 parent b3eee83 commit 45a6abc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/RememberedFile.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Photogabble\LaravelRememberUploads;
4+
5+
class RememberedFile extends \Symfony\Component\HttpFoundation\File\UploadedFile
6+
{
7+
8+
/**
9+
* Returns whether the file was uploaded successfully.
10+
*
11+
* @return bool True if the file has been uploaded with HTTP and no error occurred
12+
*/
13+
public function isValid()
14+
{
15+
$isOk = UPLOAD_ERR_OK === $this->error;
16+
17+
return $isOk; // @todo check that pathname is within the expected storage directory
18+
//return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname());
19+
}
20+
21+
}

0 commit comments

Comments
 (0)