cannot upload image input type=file expo 32 / react-native

Hello -

I am unable to upload a photo from the photo library in iOS simulator using Expo 32 and it’s version of React-Native (RN - 0.57?)

I reviewed the link ‘cannot use input type file in webview (with Expo’ but although the writer of the post indicates that the problem has been solved (back in Expo 30) I am encountering the same problem with expo 32. The choose photo dialog does pop up, but it doesn’t seem to transfer the photo from the simulator / device to the PHP page.

I do note that with creating a react-native project without expo, using RN 0.59, I can get a file to upload fine on iOS no problem.

Here is my current source code:

import React from 'react';
import {StyleSheet, Button, View, WebView} from 'react-native';

export default class App extends React.Component {
    render() {
        let WebViewRef;
        return (
            <View style={styles.container}>
                <WebView useWebKit={true} source={{uri: "__url__"}}
                         ref={WEBVIEW_REF => (WebViewRef = WEBVIEW_REF)}
                         domStorageEnabled={true}
                         mixedContentMode={'compatibility'}
                         startInLoadingState={true}
                         allowUniversalAccessFromFileURLs={true}
                         allowsInlineMediaPlayback={true}
                         allowFileAccess={true}/>
                <Button title="Refresh View" onPress={() => {
                    WebViewRef && WebViewRef.reload();
                }}/>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        /* alignItems: 'center', */
        backgroundColor: '#00ff00',
        paddingTop:50,
        padding: 8
    },
});

where url is the destination page to upload the photo to.

the input tag of type file currently looks like this:

        <input id="file" name="file" type="file" accept="image/*, video/*;capture=camera"/>

Also, the page containing the input tag works fine by itself (it can accept a file from the web browser and the rest of the workflow simply shows the photo for now).

Any help or advice appreciated. thanks

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.