ClientFileSystem
Features
How to Use
Retrieve Files
Write File
Read File
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
// get a directory from the client.
var directory = await ClientFileSystem.ShowDirectoryPickerAsync();
// get the files from that directory.
var fileHandles = await directory.GetFilesAsync("*.docx");using (var fs = new FileStream(Application.MapPath("some/file.docx"), FileMode.Open)
{
fileHandle.WriteBytesAsync(fs.ToArray(), 0, WritableType.Write, false);
}// retrieve the first handle.
var fileHandle = files[0];
// query read and write permissions on the file.
var state = await fileHandle.QueryPermissionAsync(Permission.ReadWrite);
if (state == PermissionState.Granted)
{
// read and load the file.
var bytes = await fileHandle.ReadBytesAsync();
}