com\setasign\Konquadrat\File

ExternalFile Class SavedFile

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

Class hierarchy

Implements

Summary

Properties

$externalDirectoryName

$externalFilePath


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()

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()

Get the content type.

getExternalDirectoryName()

public ExternalFile::getExternalDirectoryName (
void
): string

getExternalFilePath()

public ExternalFile::getExternalFilePath (
void
): string

getFileName()

Get the file name

getFilePath()

withFileName()

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

Parameters
$newFileName: string