react-native-blob-util: ReactNativeBlobUtil.copyToInternal is not a function on IOS

  • please provide the version of installed library and RN project.
  • “react-native-blob-util”: “^0.15.0”,
  • “react-native”: “0.67.2”,
  • a sample code snippet/repository is very helpful to spotting the problem. const dirToFiles = ReactNativeBlobUtil.fs.dirs.DocumentDir + '/' + file.name; await ReactNativeBlobUtil.MediaCollection.copyToInternal(file.uri, dirToFiles);

console.log(file.uri) 'file:///private/var/mobile/Containers/Data/Application/CEA2ECD6-B04B-4700-B18C-41FBB3183403/tmp/com.cloudworkpro.mobile-Inbox/4dayseriousmass.pdf',

  • issues which have been tagged as ‘needs feedback’, will be closed after 2 weeks if receive no feedbacks.
  • issues lack of detailed information will be closed without any feedback

Hello there, I am trying to use copyToInternal method on iOS. On android, it seems to work as expected but on IOS I keep getting this error.

TypeError: ReactNativeBlobUtil.copyToInternal is not a function. (In 'ReactNativeBlobUtil.copyToInternal(contenturi, destpath)', 'ReactNativeBlobUtil.copyToInternal' is undefined)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Please try to do a .replace('file://', '')' on the path for iOS to remove the file:// prefix.

Dude you’re a legend!! it worked lol

MediaStore / MediaColelction is an andorid only feature, thus that method is only available for android.

Awesome, thank you for responding quickly and helping me out I appreciate it Going to test this now