private static function ServerRequest::createUploadedFileFromSpec in Lockr 7.3
Create and return an UploadedFile instance from a $_FILES specification.
If the specification represents an array of values, this method will delegate to normalizeNestedFileSpec() and return that return value.
Parameters
array $value $_FILES struct:
Return value
array|UploadedFileInterface
2 calls to ServerRequest::createUploadedFileFromSpec()
- ServerRequest::normalizeFiles in vendor/
guzzlehttp/ psr7/ src/ ServerRequest.php - Return an UploadedFile instance array.
- ServerRequest::normalizeNestedFileSpec in vendor/
guzzlehttp/ psr7/ src/ ServerRequest.php - Normalize an array of file specifications.
File
- vendor/
guzzlehttp/ psr7/ src/ ServerRequest.php, line 114
Class
- ServerRequest
- Server-side HTTP request
Namespace
GuzzleHttp\Psr7Code
private static function createUploadedFileFromSpec(array $value) {
if (is_array($value['tmp_name'])) {
return self::normalizeNestedFileSpec($value);
}
return new UploadedFile($value['tmp_name'], (int) $value['size'], (int) $value['error'], $value['name'], $value['type']);
}