File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ class DownloadCustomOption extends \Magento\Framework\App\Action\Action implemen
29
29
/**
30
30
* @var \Magento\Framework\Unserialize\Unserialize
31
31
* @deprecated 101.0.0
32
+ * @deprecated No longer used
33
+ * @see $serializer
32
34
*/
33
35
protected $ unserialize ;
34
36
@@ -106,7 +108,7 @@ public function execute()
106
108
if ($ this ->getRequest ()->getParam ('key ' ) != $ info ['secret_key ' ]) {
107
109
return $ resultForward ->forward ('noroute ' );
108
110
}
109
- $ this ->download ->downloadFile ($ info );
111
+ return $ this ->download ->createResponse ($ info );
110
112
} catch (\Exception $ e ) {
111
113
return $ resultForward ->forward ('noroute ' );
112
114
}
Original file line number Diff line number Diff line change @@ -67,8 +67,22 @@ public function __construct(
67
67
* @param array $info
68
68
* @return void
69
69
* @throws \Exception
70
+ * @deprecated No longer recommended
71
+ * @see createResponse()
70
72
*/
71
73
public function downloadFile ($ info )
74
+ {
75
+ $ this ->createResponse ($ info );
76
+ }
77
+
78
+ /**
79
+ * Returns a file response
80
+ *
81
+ * @param array $info
82
+ * @return \Magento\Framework\App\ResponseInterface
83
+ * @throws \Exception
84
+ */
85
+ public function createResponse ($ info )
72
86
{
73
87
$ relativePath = $ info ['order_path ' ];
74
88
if (!$ this ->_isCanProcessed ($ relativePath )) {
@@ -80,7 +94,7 @@ public function downloadFile($info)
80
94
);
81
95
}
82
96
}
83
- $ this ->_fileFactory ->create (
97
+ return $ this ->_fileFactory ->create (
84
98
$ info ['title ' ],
85
99
['value ' => $ this ->_rootDir ->getRelativePath ($ relativePath ), 'type ' => 'filename ' ],
86
100
$ this ->rootDirBasePath ,
You can’t perform that action at this time.
0 commit comments