IONIC의 "cordova-plugin-file"플러그인을 사용하여 안드로이드 장치에서 (이동식) SD 카드에 쓰기를 시도해 보았습니다.ionic externalRootDirectory SD 카드에 쓰기 실패
은 문서로
externalRootDirectory
지정 "안드로이드 :. 외부 저장 장치 (SD 카드) 루트를" 그러나
, 나는이 디렉토리에 쓰기 :
this.file.resolveDirectoryUrl(this.file.externalRootDirectory)
.then((data)=>{
result += "\n" + "resolveDirectoryUrl";
newBasePath = data.nativeURL;
this.file.createDir(newBasePath, newDirName, true)
.then(()=>{
result += "\n" + "createDir";
this.file.createFile(newBasePath, newFilePath, true)
.then(()=>{
result += "\n" + "createFile";
this.file.writeFile(newBasePath, newFilePath, this.thisRouteFile, {append:true})
.then(() => {
result += "\n" + "writeFile OK";
});
});
});
});
항상 내부 메모리 또는 에뮬레이션이 아닌 이동식 SD 카드에 기록됩니다 파일. 문제의 많은 논의가있다
, 일부는
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
을 인용하지만 난 어떤 해결책을 발견했다.
이동식 SD 카드에 쓸 수 있습니까?
현재 어떤 디렉토리 경로가 사용되고 있는지 알려주십시오. 또한 SD 카드에 어떤 경로가 사용되는지 알려줍니다. – greenapps