```dart
import 'package:amplify_flutter/amplify_flutter.dart';

Future<void> uploadProtectedFile({
  required String filePath,
  required String key,
}) async {
  final awsFile = AWSFile.fromPath(filePath);
  const options = StorageUploadFileOptions(
    accessLevel: StorageAccessLevel.protected,
  );

  try {
    final uploadResult = await Amplify.Storage.uploadFile(
      localFile: awsFile,
      key: key,
      options: options,
    ).result;
    safePrint('Uploaded file: ${uploadResult.uploadedItem.key}');
  } on StorageException catch (e) {
    safePrint('Something went wrong uploading file: ${e.message}');
    rethrow;
  }
}
```