fileName = ObjectSerializer::sanitizeFilename($file); $this->content = \GuzzleHttp\Psr7\Utils::streamFor($file); } else { $meta_data = stream_get_meta_data($file); $this->fileName = ObjectSerializer::sanitizeFilename($meta_data['uri']); $this->content = \GuzzleHttp\Psr7\Utils::streamFor($file); } } /** * @return string */ public function getFileName() { return $this->fileName; } /** * @param string $fileName * @return MultiPartFile */ public function setFileName($fileName) { $this->fileName = $fileName; return $this; } /** * @return StreamInterface */ public function getContent() { return $this->content; } /** * @param StreamInterface $content * @return MultiPartFile */ public function setContent($content) { $this->content = $content; return $this; } }