/
UploadedFile.php
51 lines (45 loc) · 1.05 KB
/
UploadedFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace HZ\Contracts\Http;
interface UploadedFile
{
/**
* Get file name
*
* @return string
*/
public function name(): string;
/**
* Get file extension
*
* @return string
*/
public function extension(): string;
/**
* Get file mime type
*
* @return string
*/
public function mime(): string;
/**
* Get file size in bits
*
* @return int
*/
public function size(): int;
/**
* Store the file to the given directory and return full stored file location
* The file name will be generated randomly
*
* @param string $directory
* @return string
*/
public function store(string $directory = null): string;
/**
* Store the file to the given directory with the given name and return full stored file location
*
* @param string $savedName
* @param string $directory
* @return string
*/
public function storeAs(string $savedName, string $directory = null): string;
}