S
S
stransens2019-05-07 15:29:17
iPhone
stransens, 2019-05-07 15:29:17

In the React app, loading an image from an iPhone on wi-fi is very slow, on the mobile Internet it is excellent. Someone faced?

I have an application written in React. Images are loaded using the following code:

<input type='file' id='single-file' onChange={props.onChange}/>

onChange = e => {
                let ua = navigator.userAgent;
                let is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
                if (is_ie === true) {
                        let file = document.getElementById('single-file').files[0];
                        this.props.uploadImage(file);
                        this.props.openUpload(true);
                } else {
                        this.props.uploadImage(e.target.files[0]);
                        this.props.openUpload(true);
                        e.target.value = '';
                }
        };

sent as standard by the axios module using FormData.
When testing, it turned out that sending files from a PC and Android phones is fast and normal. But on the iPhone on the mobile Internet of the network, the photo is sent perfectly, but it takes about two to three minutes on wi-fi. We checked different iPhones (X, XR, 6, 7), different browsers, different wi-fi networks - the result is the same.
Maybe someone faced a similar problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
BasiC2k, 2019-05-07
@BasiC2k

Perhaps the reason is caching (local or provider).

B
bpGusar, 2019-05-14
@bpGusar

Are you sure it's because of react and because of wi fi?
in my opinion there is no connection here, the problem here is on the Internet
should be tested on different wi-fi networks of different providers and also with different mobile operators

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question