StackUser
StackUser

Reputation: 426

React native:Error:Location ..... isn't movable

i have recorded some audio files,then i am trying to move that audio files to default path to folder.in that am getting error like Error: Location '''file:///data/data/host.exp.exponent/cache/ExperienceData/%40Fanonymous%2FCCameraApplication/filename.3gp''' isn't movable. if any one faced same problem please let me know. but my default path is:file:///data/data/host.exp.exponent/cache/ExperienceData/%2540anonymous%252FCCameraApplication/filename.3gp

here am attaching my sample code.

const info = await FileSystem.getInfoAsync(this.recording.getURI());
    console.log(`FILE INFO: ${JSON.stringify(info)}`);
    const currentTime=Date.now();
    await FileSystem.moveAsync({
      from: `${JSON.stringify(info.uri)}`,
      to: `${FileSystem.documentDirectory}audios/${currentTime}.3gp`,
    });

Upvotes: 1

Views: 1190

Answers (1)

Stan Sarr
Stan Sarr

Reputation: 243

Expo’s FileSystem module can copy/move/etc. files that are previously saved in the app’s scope (for example via ImagePicker or using Asset.loadAsync). ImagerEditor is a core React Native functionality and it saves your image to a file that is outside Expo’s scope, thus FileSystem cannot perform actions on this file. Is this a bit clearer now?

More Info: https://forums.expo.io/t/where-does-camera-takepictureasync-save-photos/6475/7

Upvotes: 1

Related Questions