maui-file-handling

Guide cross-platform file access in .NET MAUI apps.

Updated Nov 27, 2025
One-click install
npx skills add https://github.com/seydakaratekeli/KamPay3 --skill maui-file-handling-seydakaratekeli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-file-handling
Source: https://github.com/seydakaratekeli/KamPay3/tree/main/KamPay/.github/skills/maui-file-handling%20-%20Kopyala
Command: npx skills add https://github.com/seydakaratekeli/KamPay3 --skill maui-file-handling-seydakaratekeli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides developers to master cross-platform file access in .NET MAUI, addressing issues like content URIs vs file paths, read-only bundled resources, and consistent writable paths across Android, iOS, macOS, and Windows.

Core Features & Use Cases

  • Cross-platform FilePicker usage: select and read files via OpenReadAsync without relying on FullPath.
  • Bundled vs. writable data handling: learn how to copy Resources/Raw assets to AppDataDirectory for write operations.
  • Platform path and permission guidance: correct FilePickerFileType usage, AppDataDirectory/CacheDirectory usage, and per-platform permissions.

Quick Start

Copy a bundled file from Resources/Raw to AppDataDirectory, then open and read it.

Frequently Asked Questions about maui-file-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pick and read files in .NET MAUI without using FullPath?

Use FilePicker with OpenReadAsync to read files in .NET MAUI without relying on FullPath, which may return content URIs instead of actual file paths on Android.

Why can't I write to bundled resources in MAUI and how do I fix it?

Bundled resources in MAUI are read-only. To write to them, copy the file from Resources/Raw to a writable location like AppDataDirectory using OpenAppPackageFileAsync, then perform write operations on the copied file.

What is the difference between AppDataDirectory and CacheDirectory in .NET MAUI?

AppDataDirectory stores persistent app data that survives across sessions, while CacheDirectory holds temporary data that the system may clear. Use AppDataDirectory for essential files and CacheDirectory for disposable cached content in MAUI apps.

Does .NET MAUI FilePicker work across Android, iOS, macOS, and Windows?

Yes, .NET MAUI FilePicker works across Android, iOS, macOS, and Windows. You must configure platform-specific FilePickerFileType definitions and handle per-platform permissions to ensure consistent file picking behavior.

How do I copy a bundled asset to a writable directory in MAUI?

To copy a bundled asset in MAUI, use OpenAppPackageFileAsync to read the file from Resources/Raw, then write the stream to a new file in AppDataDirectory. This makes the previously read-only bundled resource fully writable.

What file type formats should I specify for MAUI FilePicker on different platforms?

Specify FilePickerFileType definitions per platform when using MAUI FilePicker. Android, iOS, macOS, and Windows each expect different MIME types or file extension formats to correctly filter and select files during the picking process.