Open nodabasi opened 2 years ago
Hi, I faced the same issue.
I found that param path
need to begin with 'file://' on iOS platform.
My code is like:
export const uploadImage = async (
filePath: string,
remoteUrl: string
): Promise<string> => {
const FPrefix = 'file://';
let newFilePath = filePath.replace(FPrefix, '');
// param @path here must begin with 'file://', but Android App dont need ths.
const options: MultipartUploadOptions = {
url: encodeURI(remoteUrl),
path: encodeURI(Platform.OS === 'ios' ? (FPrefix + filePath) : newFilePath),
method: 'POST',
field: 'file',
type: 'multipart'
}
return Upload.startUpload(options);
}
In my development, simulation upload works fine both in android and iOS both for videos and images. However, whenever I tried on the real devices it didn't work a new field creates in my db with 0 bytes. Also, uploads finishes instantly, for example for 1 min. long video(90-120mb) it also finishes instantly.
Can you help me with that?