Closed amosbastian closed 3 years ago
i think when using the manipulator we might loss the type and name , ill check .
I managed to solve it for myself by doing this:
const files = assets.map(asset => {
const file = new ReactNativeFile(asset);
if (!file.type) {
file.type = 'image/png';
}
if (!file.name) {
file.name = Date.now() + '.png';
}
return file;
});
I am trying to convert the assets to a
ReactNativeFile
since this is what my upload endpoint (usinggraphql-upload
) expects to receive. When usingexpo-image-picker
andexpo-image-picker-manipulator
myself this works completely fine and the convertedReactNativeFile
can be uploaded fine. Unfortunately when using your library it results in aReactNativeFile
with an undefinedname
andtype
. I am not sure why this is happening.