[] Give option to not use original file name in output file

Author: adxzhang1Created Nov 3, 2024Updated Apr 28, 2026
Labels:star2: Feature Request

Description

On iOS, picking a video will create a temporary file in cache with name <Original file name>. When the original file name has white space, the file name that is stored in cache contains white space. However the resulting Asset.uri encodes the file path so that white spaces are replaced with %20.

For example: Original file name: My Video.mp4 Output file path: <Temporary directory>/My Video.mp4 Output Asset.uri: file://<Temporary directory>/My%20Video.mp4

This causes issues when using the Asset.uri in libraries such as react-native-fs or ffmpeg-kit-react-native, because the encoded uri does not actually exist; instead the version with white spaces exists.

This issue is not seen in android b/c the output file does not use the original file name.

Proposed Solution

Add an option such as omitOriginalFileName: true and have the output file not include the original file name.

Test Solution

Validate output file does not contain original file name.

Source: react-native-image-picker/react-native-image-picker