• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move files from applicationStorage to Documents in app

Contributor ,
Jan 14, 2022 Jan 14, 2022

Copy link to clipboard

Copied

Hi, 

 

I've got an app that, since 5 years now, that displays an offline map by reading from a folder embed in it ("assets").

Since Android 11, it's impossible to read from ApplicationStorage (Error #3001: File or directory access denied), so I'm trying to copy the folder from applicationStorage to "Documents". 

 

What I did :

 

 

source = File.applicationDirectory.resolvePath("assets/maps");
destination = File.documentsDirectory.resolvePath("Documents/www");
source.addEventListener(Event.COMPLETE, onMapCopyComplete);
source.copyToAsync(destination, false);

function onMapCopyComplete(e: Event): void {
	source.removeEventListener(Event.COMPLETE, onMapCopyComplete);

	log("onMapCopyComplete()");
}

 

 

 

I've got a return onMapCopyComplete() but when I'm looking in InternalStorage/Documents of my phone I've got the folders but all are empty... None of the files were copy..

 

149484181-113ea1af-9c7e-45b2-869c-2e0e0a28ecf5.png

TOPICS
ActionScript

Views

91

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2022 Jan 16, 2022

Copy link to clipboard

Copied

LATEST

File.applicationDirectory contains the installed files, not saved files. are you sure you don't mean File.applicationStorageDirectory?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines