Overview

Namespaces

  • Docta
    • MercadoLibre
      • OAuth2
        • Client
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
    • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Token
        • Tool
  • Psr
    • Http
      • Message

Classes

  • AppendStream
  • BufferStream
  • CachingStream
  • DroppingStream
  • FnStream
  • InflateStream
  • LazyOpenStream
  • LimitStream
  • MultipartStream
  • NoSeekStream
  • PumpStream
  • Request
  • Response
  • ServerRequest
  • Stream
  • StreamWrapper
  • UploadedFile
  • Uri
  • UriNormalizer
  • UriResolver

Traits

  • MessageTrait
  • StreamDecoratorTrait

Functions

  • build_query
  • copy_to_stream
  • copy_to_string
  • hash
  • mimetype_from_extension
  • mimetype_from_filename
  • modify_request
  • normalize_header
  • parse_header
  • parse_query
  • parse_request
  • parse_response
  • readline
  • rewind_body
  • str
  • stream_for
  • try_fopen
  • uri_for
  • Overview
  • Namespace
  • Class
  • Download

Class UploadedFile

Value object representing a file uploaded through an HTTP request.

Instances of this interface are considered immutable; all methods that might change state MUST be implemented such that they retain the internal state of the current instance and return an instance that contains the changed state.

GuzzleHttp\Psr7\UploadedFile implements Psr\Http\Message\UploadedFileInterface
Namespace: GuzzleHttp\Psr7
Located at src/UploadedFile.php
Methods summary
public
# __construct( Psr\Http\Message\StreamInterface|string|resource $streamOrFile, integer $size, integer $errorStatus, string|null $clientFilename = null, string|null $clientMediaType = null )

Parameters

$streamOrFile
$size
$errorStatus
$clientFilename
$clientMediaType
public boolean
# isMoved( )

Returns

boolean
public Psr\Http\Message\StreamInterface
# getStream( )

Retrieve a stream representing the uploaded file.

Retrieve a stream representing the uploaded file.

Returns

Psr\Http\Message\StreamInterface
Stream representation of the uploaded file.

Throws

RuntimeException
if the upload was not successful.

Implementation of

Psr\Http\Message\UploadedFileInterface::getStream()
public
# moveTo( string $targetPath )

Move the uploaded file to a new location.

Move the uploaded file to a new location.

Parameters

$targetPath
Path to which to move the uploaded file.

Throws

RuntimeException
if the upload was not successful.
InvalidArgumentException
if the $path specified is invalid.
RuntimeException

on any error during the move operation, or on the second or subsequent call to the method.

See

http://php.net/is_uploaded_file
http://php.net/move_uploaded_file

Implementation of

Psr\Http\Message\UploadedFileInterface::moveTo()
public integer|null
# getSize( )

Retrieve the file size.

Retrieve the file size.

Returns

integer|null
The file size in bytes or null if unknown.

Implementation of

Psr\Http\Message\UploadedFileInterface::getSize()
public integer
# getError( )

Retrieve the error associated with the uploaded file.

Retrieve the error associated with the uploaded file.

Returns

integer
One of PHP's UPLOAD_ERR_XXX constants.

See

http://php.net/manual/en/features.file-upload.errors.php

Implementation of

Psr\Http\Message\UploadedFileInterface::getError()
public string|null
# getClientFilename( )

Retrieve the filename sent by the client.

Retrieve the filename sent by the client.

Returns

string|null

The filename sent by the client or null if none was provided.

Implementation of

Psr\Http\Message\UploadedFileInterface::getClientFilename()
public string|null
# getClientMediaType( )

Retrieve the media type sent by the client.

Retrieve the media type sent by the client.

Returns

string|null

The media type sent by the client or null if none was provided.

Implementation of

Psr\Http\Message\UploadedFileInterface::getClientMediaType()
MercadoLibre Provider for OAuth 2.0 Client API documentation generated by ApiGen