-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unlink doesn't delete the picture #352
Comments
I don't know if i got you right. You are deleting an image, right? And the UIImage shows a placeholder then because the image was already deleted? This would be as expected. |
Thanks for your answer. |
UIImage will cache Images once it was loaded, even if you remove this file later on physical device. Anyways, a second call to .exists() should return false instead of true. Have you tried this out? |
Oh, I didn't think of the cache... That's it, a second call to the functions returns an error: The file does not exist . Thanks for your help and sorry for my stupid question! |
I observe the same behavior here.
@Ignigena, any example for this? |
I believe I am having a similar issue but I am trying to delete a video. I get the video taken by react-native-camera and then I do this
I even threw in that extra exists after the unlink to confirm that the file is gone. It throws no errors and the double check even confirms that it can no longer find the file. However, on my Android phone when I go to photos I can still see blank videos there that will play nothing. Furthermore, when I plug the phone into my pc I can find those files. They are taking up space but they cannot be played. They appear to be corrupt. How can I remove these files completely and not just corrupt the content? |
Have you find any work-through to remove this deleted cache image/placeholder? |
+1 |
Has this been addressed. Can we reopen this issue? |
This issue is still persisting! I am using the library just for removing a video file fetched from react-native-image-picker, after uploading the file to our server, I need to remove that local file from the user device, It happens as @chad187 has described, It keeps an existing video in Gallery, it is shown as empty video that could not be displayed. I have to restart the whole mobile device, to get rid of that empty placeholder! |
If you've still got this issue, use the scanFile API to run the Media Scanner on Android so that it notifies changes to the index, after unlinking the file. #554 has fixed this.
|
For anyone who may come across this issue in the future who is confused about these gray images left in the device's gallery: Android maintains a cache of media files on the device. When a file is deleted, the cache is not necessarily updated. See this Stack Overflow post for more info. This is why you should call |
I have to try to unlink to remove image but it storing in the pictures folder, please can #anyone advice |
What about IOS? In iOS its not deleting after unlink success |
Gallery and Google Photos remain showing the deleted videos after RNFS.scanFile. Any other ideas? |
is this issue solved ? i am getting same issue |
is this issue solved ? i am getting same issue |
using RNFS delete file is not working after 1 or 2 days |
Hello,
I use
RNFS.unlink()
to delete a picture that was taken by react-native-camera.Here is my code :
Where filepath is the name of the picture, for example : file:///storage/emulated/0/Pictures/IMG_20170926_134921.jpg .
After the operation (with no errors), here is the deleted picture :
Is there something I didn't understand ?
The text was updated successfully, but these errors were encountered: