File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2020 * @package Transcoder
2121 * @since 1.0.0
2222 */
23- class TranscoderController extends Controller
23+ class DefaultController extends Controller
2424{
2525
2626 // Protected Properties
@@ -50,5 +50,6 @@ public function actionDownloadFile()
5050 null ,
5151 ['inline ' => false ]
5252 );
53+ Craft::$ app ->end ();
5354 }
5455}
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ protected function getAssetPath($filePath): string
203203 {
204204 // If we're passed an Asset, extract the path from it
205205 if (is_object ($ filePath ) && ($ filePath instanceof Asset)) {
206- $ asset = (Asset) $ filePath ;
206+ $ asset = $ filePath ;
207207 $ assetVolume = $ asset ->getVolume ();
208208
209209 if (!(($ assetVolume instanceof Local) || is_subclass_of ($ assetVolume , Local::class))) {
@@ -212,8 +212,10 @@ protected function getAssetPath($filePath): string
212212 );
213213 }
214214
215- $ sourcePath = $ assetVolume ->path ;
216- $ folderPath = $ asset ->getFolder ()->path ;
215+ $ sourcePath = rtrim ($ assetVolume ->path , DIRECTORY_SEPARATOR );
216+ $ sourcePath .= strlen ($ sourcePath ) ? DIRECTORY_SEPARATOR : '' ;
217+ $ folderPath = rtrim ($ asset ->getFolder ()->path , DIRECTORY_SEPARATOR );
218+ $ folderPath .= strlen ($ folderPath ) ? DIRECTORY_SEPARATOR : '' ;
217219
218220 $ filePath = $ sourcePath .$ folderPath .$ asset ->filename ;
219221 }
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function getDownloadUrl($url): string
7373 $ urlParams = [
7474 'url ' => urlencode ($ url ),
7575 ];
76- $ result = UrlHelper::actionUrl ('transcoder/downloadFile ' , $ urlParams );
76+ $ result = UrlHelper::actionUrl ('transcoder/default/download-file ' , $ urlParams );
7777 }
7878
7979 return $ result ;
You can’t perform that action at this time.
0 commit comments