22namespace verbb \formie \controllers ;
33
44use verbb \formie \Formie ;
5+ use verbb \formie \helpers \Assets ;
56use verbb \formie \helpers \HandleHelper ;
67use verbb \formie \helpers \ImportExportHelper ;
78use verbb \formie \helpers \StringHelper ;
@@ -51,7 +52,7 @@ public function actionImport(): ?Response
5152 }
5253
5354 $ filename = 'formie-import- ' . gmdate ('ymd_His ' ) . '.json ' ;
54- $ fileLocation = Craft:: $ app -> getPath ()-> getTempPath () . DIRECTORY_SEPARATOR . $ filename ;
55+ $ fileLocation = Assets:: getTempPath ($ filename) ;
5556
5657 move_uploaded_file ($ uploadedFile ->tempName , $ fileLocation );
5758
@@ -65,7 +66,7 @@ public function actionImportConfigure(string $filename): ?Response
6566 {
6667 $ request = $ this ->request ;
6768
68- $ fileLocation = Craft:: $ app -> getPath ()-> getTempPath () . DIRECTORY_SEPARATOR . $ filename ;
69+ $ fileLocation = Assets:: getTempPath ($ filename) ;
6970
7071 if (!file_exists ($ fileLocation )) {
7172 throw new HttpException (404 );
@@ -148,7 +149,7 @@ public function actionImportComplete(): ?Response
148149 $ filename = $ request ->getParam ('filename ' );
149150 $ formAction = $ request ->getParam ('formAction ' );
150151
151- $ fileLocation = Craft:: $ app -> getPath ()-> getTempPath () . DIRECTORY_SEPARATOR . $ filename ;
152+ $ fileLocation = Assets:: getTempPath ($ filename) ;
152153
153154 if (!file_exists ($ fileLocation )) {
154155 throw new HttpException (404 );
0 commit comments