com\setasign\SetaFramework\FileSystem
SavedFile Class SavedFile
File: /SetaFramework/src/FileSystem/SavedFile.php
This class represent a file within the filesystem.
Class hierarchy
Implements
Summary
Properties
$contentType
protected string SavedFile::$contentType
Static Methods
createByUploadedFile()
public static SavedFile::createByUploadedFile (
\Psr\Http\Message\UploadedFileInterface $uploadedFile,
string $targetPath
): SavedFilestring $targetPath
This method will create a saved file instance by using moveTo().
Parameters
- $uploadedFile : \Psr\Http\Message\UploadedFileInterface
- $targetPath : string
Exceptions
Throws \com\setasign\SetaFramework\Request\UploadException If the $uploadedFile has an error.
See
- \Psr\Http\Message\UploadedFileInterface::moveTo()
Methods
__construct()
SavedFile constructor.
Parameters
- $fileName : string
- $contentType : string
- $filePath : string
export()
Will export the saved file as unsaved file.
Parameters
- $asString : bool
If true the file will be read immediately and the content will be kept in the memory. Otherwise the file will be read as a stream.
Exceptions
Throws \com\setasign\SetaFramework\Exception If the file cannot be read.
withFileName()
Returns a new instance of the file with another file name.
Parameters
- $newFileName : string
