dzatona's avatar

Uploading file from iPhone's camera to Laravel

Hello,

I am trying to upload the file to Laravel. Everything works fine except this case: when I'm using the mobile phone (Apple iPhone 8 Plus) AND trying to upload not file from the gallery, but the file from a camera — system saves zero sized file on a server. When I try to upload from a gallery — everything goes smoothly.

Any advice is appreciated.

0 likes
7 replies
aurawindsurfing's avatar

The first thing to look at would be php.ini 'upload_max_size' and 'post_max_size'.

'upload_max_size' by default is set to 2M and you picture might be bigger then that.

Hope it helps!

dzatona's avatar

Thanks for your attention. I've tried different "solutions" and finally got some discussion where said that captures from the camera should be uploaded via XHR. And they provided some JS solution for that. After I decided to check file size and if it is equal 0, then redirect back with an error saying "Camera uploads are prohibited. Choose a file from gallery". Not so perfect end, but...

fransyozef's avatar

Are you uploading from a native/hybrid app? Or via a HTML page in Safari?

dzatona's avatar

Laravel (HTML page in Safari and other browsers).

Please or to participate in this conversation.