com\setasign\Konquadrat\File
ExternalFile Class SavedFile
File: /Konquadrat/src/File/ExternalFile.php
Class hierarchy
Implements
Summary
Properties
$contentType
protected string \com\setasign\SetaFramework\FileSystem\SavedFile::$contentType
$externalDirectoryName
protected ExternalFile::$externalDirectoryName
$externalFilePath
protected ExternalFile::$externalFilePath
$fileName
protected string \com\setasign\SetaFramework\FileSystem\SavedFile::$fileName
Static Methods
createByUploadedFile()
public static \com\setasign\SetaFramework\FileSystem\SavedFile::createByUploadedFile (
\Psr\Http\Message\UploadedFileInterface $uploadedFile,
string $targetPath
): \com\setasign\SetaFramework\FileSystem\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()
public ExternalFile::__construct (
string $externalDirectoryName,
string $directoryPath,
string $externalFilePath
)string $directoryPath,
string $externalFilePath
Parameters
- $externalDirectoryName: string
- $directoryPath: string
- $externalFilePath: string
export()
public \com\setasign\SetaFramework\FileSystem\SavedFile::export (
bool $asString = false
): \com\setasign\SetaFramework\FileSystem\UnsavedFileWill 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.
getFileContent()
public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContent (
void
): \com\setasign\SetaFramework\FileSystem\FilePathGet the content of the file.
withFileName()
public ExternalFile::withFileName (
string $newFileName
): \com\setasign\SetaFramework\FileSystem\FileReturns a new instance of the file with another file name.
Parameters
- $newFileName: string
