- $zip = static::zipUploadFromData($zipData);
- rename($zip->getRealPath(), storage_path($import->path));
+ $zip = static::zipUploadFromData($zipData, $files);
+ $targetPath = storage_path($import->path);
+ $targetDir = dirname($targetPath);
+
+ if (!file_exists($targetDir)) {
+ mkdir($targetDir);
+ }
+
+ rename($zip->getRealPath(), $targetPath);