- Home /
Question by
admin_gzoe · Oct 08, 2019 at 06:58 AM ·
androidfile
Error occurs when trying to delete file in DCIM on Android
An error occurs when trying to change file attributes or delete file in DCIM on Unity Android App.
The codes are as follows.
a)
File.SetAttributes(config.inputPath, FileAttributes.Normal);
b)
File.Delete(config.inputPath);
The error is as follows.
2019-10-08 12:05:37.205 19864-19910/? E/Unity: UnauthorizedAccessException: Access to the path
"/storage/emulated/0/Android/data/jp.ne.company.app/files/../../../../DCIM/VideoRecorders/20191008120525_video.mp4" is denied.
By the way, files in the application-specific directories (/storage/emulated/0/Android/data/jp.ne.company.app/files/) can be deleted normally.
Also, I can copy files to DCIM. The code is as follows.
System.IO.File.Copy (Application.persistentDataPath + "/" + VIDEO_NAME + ".mp4", Application.persistentDataPath + GALLERY_PATH + "/" + saveDate + "_video.mp4");
Comment
Your answer

Follow this Question
Related Questions
My build size randomly doubled Andriod 1 Answer
Android file path? 0 Answers
Saving data in to files (Android) 1 Answer
Where is the persistent data path on my Android phone? 3 Answers