move method
Move the file into a local path on disk. Creates directories as needed.
Implementation
Future<String> move({required String toPath, required String name}) async {
final fullPath = sanitizeRoutePath('$toPath/$name');
final file = File(fullPath);
await file.parent.create(recursive: true);
await file.writeAsBytes(await bytes);
// strip leading /public if used
return fullPath.replaceFirst(RegExp(r'^/?public'), '');
}