Open Journal Systems  3.3.0
Guzzle\Http\Message\PostFile Class Reference
Inheritance diagram for Guzzle\Http\Message\PostFile:
Guzzle\Http\Message\PostFileInterface

Public Member Functions

 __construct ($fieldName, $filename, $contentType=null, $postname=null)
 
 getContentType ()
 
 getCurlString ()
 
 getCurlValue ()
 
 getFieldName ()
 
 getFilename ()
 
 getPostname ()
 
 setContentType ($type)
 
 setFieldName ($name)
 
 setFilename ($filename)
 
 setPostname ($postname)
 

Protected Member Functions

 guessContentType ()
 

Protected Attributes

 $contentType
 
 $fieldName
 
 $filename
 
 $postname
 

Detailed Description

POST file upload

Definition at line 12 of file PostFile.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Http\Message\PostFile::__construct (   $fieldName,
  $filename,
  $contentType = null,
  $postname = null 
)
Parameters
string$fieldNameName of the field
string$filenameLocal path to the file
string$postnameRemote post file name
string$contentTypeContent-Type of the upload

Definition at line 25 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$contentType, Guzzle\Http\Message\PostFile\$fieldName, Guzzle\Http\Message\PostFile\$filename, Guzzle\Http\Message\PostFile\$postname, Guzzle\Http\Message\PostFile\guessContentType(), and Guzzle\Http\Message\PostFile\setFilename().

Member Function Documentation

◆ getContentType()

Guzzle\Http\Message\PostFile::getContentType ( )

Get the Content-Type of the file

Returns
string

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 85 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$contentType.

◆ getCurlString()

Guzzle\Http\Message\PostFile::getCurlString ( )
Deprecated:
@codeCoverageIgnore

Definition at line 111 of file PostFile.php.

References Guzzle\Http\Message\PostFile\getCurlValue(), and Guzzle\Common\Version\warn().

◆ getCurlValue()

Guzzle\Http\Message\PostFile::getCurlValue ( )

Get a cURL ready string or CurlFile object for the upload

Returns
string

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 90 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$contentType, and Guzzle\Http\Message\PostFile\$postname.

Referenced by Guzzle\Http\Message\PostFile\getCurlString().

◆ getFieldName()

Guzzle\Http\Message\PostFile::getFieldName ( )

Get the name of the field

Returns
string

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 40 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$fieldName.

◆ getFilename()

Guzzle\Http\Message\PostFile::getFilename ( )

Get the full path to the file

Returns
string

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 68 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$filename.

◆ getPostname()

Guzzle\Http\Message\PostFile::getPostname ( )

Get the post name of the file

Returns
string

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 73 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$postname.

◆ guessContentType()

Guzzle\Http\Message\PostFile::guessContentType ( )
protected

Determine the Content-Type of the file

Definition at line 120 of file PostFile.php.

References Guzzle\Http\Mimetypes\getInstance().

Referenced by Guzzle\Http\Message\PostFile\__construct().

◆ setContentType()

Guzzle\Http\Message\PostFile::setContentType (   $type)

Set the Content-Type of the file

Parameters
string$typeContent type
Returns
self

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 78 of file PostFile.php.

◆ setFieldName()

Guzzle\Http\Message\PostFile::setFieldName (   $name)

Set the name of the field

Parameters
string$nameField name
Returns
self

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 33 of file PostFile.php.

◆ setFilename()

Guzzle\Http\Message\PostFile::setFilename (   $path)

Set the path to the file

Parameters
string$pathFull path to the file
Returns
self
Exceptions
InvalidArgumentExceptionif the file cannot be read

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 45 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$filename.

Referenced by Guzzle\Http\Message\PostFile\__construct().

◆ setPostname()

Guzzle\Http\Message\PostFile::setPostname (   $name)

Set the post name of the file

Parameters
string$nameThe new name of the file
Returns
self

Implements Guzzle\Http\Message\PostFileInterface.

Definition at line 61 of file PostFile.php.

References Guzzle\Http\Message\PostFile\$postname.

Field Documentation

◆ $contentType

Guzzle\Http\Message\PostFile::$contentType
protected

◆ $fieldName

Guzzle\Http\Message\PostFile::$fieldName
protected

◆ $filename

Guzzle\Http\Message\PostFile::$filename
protected

◆ $postname


The documentation for this class was generated from the following file: