src/Robtimus/Multipart/MultipartFormData.php
/**
     * Adds a file parameter
     * @param string $name the parameter name.
     * @param string $filename the name of the file.
     * @param string|resource|callable $content the file's content.
     *        If it's a callable it should take a length argument and return a string that is not larger than the input.
     * @param string $contentType the file's content type.
     * @param int $contentLength the file's content length, or -1 if not known. Ignored if the file's content is a string.
     * @return MultipartFormData this object.
     */
Adds a file parameter
@param string $name the parameter name.
@param string $filename the name of the file.
@param string|resource|callable $content the file's content.
If it's a callable it should take a length argument and return a string that is not larger than the input.
@param string $contentType the file's content type.
@param int $contentLength the file's content length, or -1 if not known. Ignored if the file's content is a string.
@return MultipartFormData this object.
Adds a file parameter @param string $name the parameter name . @param string $filename the name of the file . @param string|resource|callable $content the file ' s content . If it ' s a callable it should take a length argument and return a string that is not larger than the input . @param string $contentType the file ' s content type . @param int $contentLength the file ' s content length or - 1 if not known . Ignored if the file ' s content is a string . @return MultipartFormData this object .
public function addFile($name, $filename, $content, $contentType, $contentLength = -1) {
        Util::validateNonEmptyString($name, '$name');
        Util::validateNonEmptyString($filename, '$filename');
        Util::validateStreamable($content, '$content');
        Util::validateNonEmptyString($contentType, '$contentType');
        Util::validateInt($contentLength, '$contentLength');
        $this->startPart();
        $this->addContentDisposition('form-data', $name, $filename);
        $this->addContentType($contentType);
        $this->endHeaders();
        $this->addContent($content, $contentLength);
        $this->endPart();
        return $this;
    }
public function addFile ( $ name , $ filename , $ content , $ contentType , $ contentLength = - 1 ) { Util :: validateNonEmptyString ( $ name , '$name' ) ; Util :: validateNonEmptyString ( $ filename , '$filename' ) ; Util :: validateStreamable ( $ content , '$content' ) ; Util :: validateNonEmptyString ( $ contentType , '$contentType' ) ; Util :: validateInt ( $ contentLength , '$contentLength' ) ; $ this -> startPart ( ) ; $ this -> addContentDisposition ( 'form-data' , $ name , $ filename ) ; $ this -> addContentType ( $ contentType ) ; $ this -> endHeaders ( ) ; $ this -> addContent ( $ content , $ contentLength ) ; $ this -> endPart ( ) ; return $ this ; }
Adds a file parameter
 @param string $name the parameter name.
Adds a file parameter @param string $name the parameter name .