*/
public function setName($name)
{
+ $this->setDispositionParameter('filename', $name);
$this->setContentTypeParameter('name', $name);
}
*/
public function getName($default = false)
{
- $name = $this->getContentTypeParameter('name');
-
- if ($default && empty($name)) {
+ if (!($name = $this->getDispositionParameter('filename')) &&
+ !($name = $this->getContentTypeParameter('name')) &&
+ $default) {
$name = preg_replace('|\W|', '_', $this->getDescription(false));
}
/**
* Get the description of this part.
*
- * @param boolean $default If the name parameter doesn't exist, should we
- * use the default name from the description
- * parameter?
+ * @param boolean $default If the description parameter doesn't exist,
+ * should we use the name of the part?
*
* @return string The description of this part.
*/