com\setasign\Konquadrat\File
ExternalFile Class SavedFile
File: /Konquadrat/src/File/ExternalFile.php
Class hierarchy
- com\setasign\SetaFramework\FileSystem\SavedFile
Implements
- \com\setasign\SetaFramework\FileSystem\File
Summary
Properties
$externalDirectoryName
protected ExternalFile::$externalDirectoryName
$externalFilePath
protected ExternalFile::$externalFilePath
$filePath
-
protected \com\setasign\SetaFramework\FileSystem\FilePath \com\setasign\SetaFramework\FileSystem\SavedFile::$filePath
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.
getContentType()
-
public \com\setasign\SetaFramework\FileSystem\SavedFile::getContentType (
void
): stringGet the content type.
getFileContent()
-
public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContent (
void
): \com\setasign\SetaFramework\FileSystem\FilePathGet the content of the file.
getFileContentAsStream()
-
public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContentAsStream (
void
): voidExceptions
Throws \com\setasign\SetaFramework\Exception
getFileContentAsString()
-
public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContentAsString (
void
): stringExceptions
Throws \com\setasign\SetaFramework\Exception
getFileName()
-
public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileName (
void
): stringGet the file name
withFileName()
public ExternalFile::withFileName (
string $newFileName
): \com\setasign\SetaFramework\FileSystem\FileReturns a new instance of the file with another file name.
Parameters
- $newFileName : string
