Skip to content

Commit 4ba0051

Browse files
committed
Alternate solution suggested by Bubasuma
1 parent 1ff5827 commit 4ba0051

File tree

1 file changed

+2
-8
lines changed
  • app/code/Magento/ImportExport/Controller/Adminhtml/Import

1 file changed

+2
-8
lines changed

app/code/Magento/ImportExport/Controller/Adminhtml/Import/Download.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,13 @@ public function execute()
106106
$fileSize = $this->sampleFileProvider->getSize($entityName);
107107
$fileName = $entityName . '.csv';
108108

109-
$this->fileFactory->create(
109+
return $this->fileFactory->create(
110110
$fileName,
111-
null,
111+
$fileContents,
112112
DirectoryList::VAR_IMPORT_EXPORT,
113113
'application/octet-stream',
114114
$fileSize
115115
);
116-
117-
$resultRaw = $this->resultRawFactory->create();
118-
$resultRaw->setContents($fileContents)
119-
->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
120-
121-
return $resultRaw;
122116
}
123117

124118
/**

0 commit comments

Comments
 (0)