diff --git a/lib/ConvertApi/Task.php b/lib/ConvertApi/Task.php index 6aa07e5..4542d63 100644 --- a/lib/ConvertApi/Task.php +++ b/lib/ConvertApi/Task.php @@ -16,11 +16,11 @@ function __construct($fromFormat, $toFormat, $params, $conversionTimeout = null) function run() { - $params = array_merge( - $this->normalizedParams(), + $params = array_replace( [ 'StoreFile' => true, - ] + ], + $this->normalizedParams() ); if ($this->conversionTimeout) { diff --git a/tests/ConvertApi/ConvertApiTest.php b/tests/ConvertApi/ConvertApiTest.php index 4429f40..04be985 100644 --- a/tests/ConvertApi/ConvertApiTest.php +++ b/tests/ConvertApi/ConvertApiTest.php @@ -77,6 +77,15 @@ public function testConvertWithFilePath() $this->assertEquals('test.pdf', $result->getFile()->getFileName()); } + public function testConvertWithStoreFileFalse() + { + $params = ['File' => 'examples/files/test.docx', 'StoreFile' => false]; + + $result = ConvertApi::convert('pdf', $params); + + $this->assertEquals('test.pdf', $result->getFile()->getFileName()); + } + public function testConvertWithAltnativeConverter() { $params = ['File' => 'examples/files/test.docx', 'converter' => 'openoffice'];