com\setasign\Konquadrat\File

ExternalFile Class SavedFile

File: /Konquadrat/src/File/ExternalFile.php

Class hierarchy

Implements

  • \com\setasign\SetaFramework\FileSystem\File

Summary

Properties

$contentType

protected string \com\setasign\SetaFramework\FileSystem\SavedFile::$contentType

$externalDirectoryName

$externalFilePath

$fileName

protected string \com\setasign\SetaFramework\FileSystem\SavedFile::$fileName

$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\SavedFile

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
)
Parameters
$externalDirectoryName : string
 
$directoryPath : string
 
$externalFilePath : string
 

export()

public \com\setasign\SetaFramework\FileSystem\SavedFile::export (
bool $asString = false
): \com\setasign\SetaFramework\FileSystem\UnsavedFile

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.

getContentType()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getContentType (
void
): string

Get the content type.

getExternalDirectoryName()

public ExternalFile::getExternalDirectoryName (
void
): string

getExternalFilePath()

public ExternalFile::getExternalFilePath (
void
): string

getFileContent()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContent (
void
): \com\setasign\SetaFramework\FileSystem\FilePath

Get the content of the file.

getFileContentAsStream()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContentAsStream (
void
): void
Exceptions

Throws \com\setasign\SetaFramework\Exception

getFileContentAsString()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileContentAsString (
void
): string
Exceptions

Throws \com\setasign\SetaFramework\Exception

getFileName()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileName (
void
): string

Get the file name

getFilePath()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFilePath (
void
): string

getFileSize()

public \com\setasign\SetaFramework\FileSystem\SavedFile::getFileSize (
void
): int

withFileName()

public ExternalFile::withFileName (
string $newFileName
): \com\setasign\SetaFramework\FileSystem\File

Returns a new instance of the file with another file name.

Parameters
$newFileName : string