forked from akai/readest
This commit is contained in:
@@ -194,7 +194,7 @@ export const nativeFileSystem: FileSystem = {
|
||||
let fname = name || getFilename(fp);
|
||||
if (isValidURL(path)) {
|
||||
return await new RemoteFile(path, fname).open();
|
||||
} else if (isContentURI(path)) {
|
||||
} else if (isContentURI(path) || (isFileURI(path) && OS_TYPE === 'ios')) {
|
||||
fname = await basename(path);
|
||||
if (path.includes('com.android.externalstorage')) {
|
||||
// If the URI is from shared internal storage (like /storage/emulated/0),
|
||||
@@ -202,6 +202,7 @@ export const nativeFileSystem: FileSystem = {
|
||||
return await new NativeFile(fp, fname, baseDir ? baseDir : null).open();
|
||||
} else {
|
||||
// Otherwise, for content:// URIs (e.g. from MediaStore, Drive, or third-party apps),
|
||||
// or file:// URIs is security scoped resource in iOS (e.g. from Files app),
|
||||
// we cannot access the file directly — so we copy it to a temporary cache location.
|
||||
const prefix = await this.getPrefix('Cache');
|
||||
const dst = await join(prefix, fname);
|
||||
|
||||
Reference in New Issue
Block a user