guzzle/guzzle — pull request #443 by travelton (2013-10-20 01:24:35+00:00)
Title: Added ability to define Postname.

PHP 5.5 allows a postname to be defined in the CURL request. This pull request adds the ability to define a postname using the "addPostFile()" function.

To define a postname, use "addPostFile('postField', '@/local/file/path/file.txt', 'newfile.txt')". The receiving resource will see "newfile.txt" instead of "file.txt".

I set the $postname to null, in the constructor, to ensure backward compatibility. The below will ensure a filename is set, when Guzzle constructs the CURL value string.

```php
PostFile.php - 63
$this->postname = $postname ? $postname : basename($this->filename);
```
The below will return the postname, if defined. If not, the basename of the original file.
```php
PostFile.php - 95
return curl_file_create($this->filename, $this->contentType, $this->postname);
```

Added a test. Tests pass on Travis-CI. Closes #442.

Reference: http://www.php.net/manual/en/curlfile.construct.php