A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

ReactJS issue with an Android | Khdemti

Khdemti uses cookies to ensure you get the best experience on our website.
GOT IT
LEARN MORE
ReactJS issue with an Android
Project description

I have several file type inputs to upload images like this:


Quan es puja una nova foto, hi ha un event de tipus 'onChange' per poder fer una previsualització de la imatge abans de pujar-la. Aquest event el defineixo així:

handleBackPreviewImage(e) {
e.preventDefault();

let reader = new FileReader();
let file = e.target.files[0];

if (file && file.type.match('image.*')) {
reader.readAsDataURL(file);
}

reader.onloadend = () => {
this.setState({
imageBackPreviewUrl: reader.result,
backFile: file
});
}


}

Then when uploading the image on an ANDROID mobile, it returns an error like this:


app.bundle.js?v=7:52242 Uncaught TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.
at RegisterExtraBase.handleBackPreviewImage (app.bundle.js?v=7:52242)
at ConnectedField.handleChange (app.bundle.js?v=7:39886)
at Object.executeOnChange (app.bundle.js?v=7:14654)
at ReactDOMComponent._handleChange (app.bundle.js?v=7:14471)
at Object.ReactErrorUtils.invokeGuardedCallback (app.bundle.js?v=7:6928)
at executeDispatch (app.bundle.js?v=7:6713)
at Object.executeDispatchesInOrder (app.bundle.js?v=7:6736)
at executeDispatchesAndRelease (app.bundle.js?v=7:6134)
at executeDispatchesAndReleaseTopLevel (app.bundle.js?v=7:6145)
at Array.forEach ()

This error only happens when the photo is made through the camera of the mobile device, if it is done from the gallery it works correctly.

Any idea of the problem?


Skills required
React.js

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: files/projet_view.php

Line Number: 94

Help us protect you better.

It is forbidden to trade outside the platform! Do not send payments or work outside the site.
SUBMIT A PROPOSAL

Looking to earn money?

  • Set your budget and deadlines
  • Describe your proposal
  • Get paid for your work
CALL FOR PROPOSALS FROM FREELANCES (5)

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: commentStatus

Filename: files/projet_view.php

Line Number: 344

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/imagesup/u13359-img.jpg" class="img-circle" style="width:70px; height: 70px;">
https://www.khdemti.com/utilisateur/profile/ouazer"> Ouafa Z.

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Marrakech, Morocco

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/Travail_model.php

Line Number: 22

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Private amount
Private duration

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/images/no-img-user.png" class="img-circle" style="width:70px; height: 70px;">
https://www.khdemti.com/utilisateur/profile/hicelmba"> Hicham E.

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Rabat, Morocco

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/Travail_model.php

Line Number: 22

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/utilisateur/profile/hicelmba">
RESUME 
Private amount
Private duration

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/public/assets/letters/J.png" class="img-circle" style="width:70px; height: 70px;">
https://www.khdemti.com/utilisateur/profile/jhonmica"> Jhon M.

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Berlin, Germany

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/Travail_model.php

Line Number: 22

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/utilisateur/profile/jhonmica">
Portfolio 2

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/utilisateur/profile/jhonmica">
RESUME 
Private amount
Private duration

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/images/no-img-user.png" class="img-circle" style="width:70px; height: 70px;">
https://www.khdemti.com/utilisateur/profile/ennnaw"> Web T.

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Casablanca, Morocco

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/Travail_model.php

Line Number: 22

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Private amount
Private duration

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/imagesup/u33183-img.jpg" class="img-circle" style="width:70px; height: 70px;">
https://www.khdemti.com/utilisateur/profile/snehgup"> Sneh G.

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Paris, France

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/Travail_model.php

Line Number: 22

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Private amount
Private duration
150 - 500
Budget
----
Average proposals
1 days
Mission duration
OPEN MISSION
Mobile Development
Local project
5 Received proposals
555 views
Cataluna, Spain
PROJECT OWNER

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

https://www.khdemti.com/public/assets/letters/P.png" class="img-circle" style="width: 300%;max-width:300%;!important; height: 50px; margin-top: 3px">
https://www.khdemti.com/utilisateur/profile/fpOPhUt1M8">Co. Perception

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 18


0.0

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Cataluna, Spain

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Filename: models/User_model.php

Line Number: 8

Submit a similar project
Post a mission
SHARE
Support center