1

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");
sido
  • 31
  • 3

0 Answers0