I have a piece of code as below which uploads a simple file as binary utilizing expo-file-system and everything works fine.
import * as FileSystem from 'expo-file-system';
const res = await FileSystem.uploadAsync(uploadUrl, uri, {
fieldName: 'file',
httpMethod: 'PUT',
uploadType: FileSystem.FileSystemUploadType.BINARY_CONTENT,
headers: headers,
});
How to show the upload progress just like a simple axios upload progress?
In case the feature is not implemented how can I still upload a file as binary using axios
to show the progress
Looking over the documentation for Expo FileSystem's uploadAsync, there does not appear to be a way to get upload progress. You likely would need to choose another mechanism to upload ; use the FileSystem to injest the file's contents, then use another URL mechanism (e.g. onUploadProgress in axios's Request Config) to upload the contents.