'Having trouble with upload pictures from iphones (and smartphones) on php move_uploaded_file
My company wants me to create a small Twitter-like system within company, with which our staff members from 36 stores can communicate each other and with headquarter staffs, and discuss and solve everyday problems.
I am using basic php functions such as move_uploaded_file() .
It works perfectly on my pc both locally and on server.
However, when I try to upload images from my iphone, it would never upload the picture.
Only the text.
Does anyone else have tried to recreate something like Twitter, where users could upload images from iphones?
Has anyone experience move_uploaded_file function only works on PC but not from smart phones?
can you please give me any advices or any suggestions on this?
I have been also informed about HEIC TO JPG conversion but even JPEG wouldnt upload from smart phones. Only the small jpg files can be uploaded from phone, so maybe it is about size, and PC having more stable Wifi internet connection?
Maybe the way I am coding to resize image is not written well?
Does anyone know what to do?
( I have been suggested to simply use existing system like facebookgroup, but this is for company employees in JAPAN, so not everyone uses certain SNS.)
here is my code in case, which I dont think is a problem since it works perfectly on PCs. (forgive me for my format... It is partial and I only cut and pasted the key parts... I just want you to get an idea that I just followed standard move_uploaded_functions I learnt from youtube tutorials)
(sorry copying and pasting my html-php mixtured code is not displaying well on stackoverflow. please let me know if you would like to take a look at any other parts...
if(isset($_FILES['yobo_attach'])):
//skipping some conditions function declarations and rearrangement of $_FILES into $file_arrays
$file_arrayName[$i] = time() . '_' . $file_array[$i]['name'];
$target_file[$i] = $file_array[$i]['tmp_name'];
$resized_file[$i] = $file_array[$i]['tmp_name'];
$hmax = 600;
$wmax = 600;
img_resize($target_file[$i], $resized_file[$i], $wmax, $hmax, $file_ext);
move_uploaded_file($resized_file[$i], $target_dir . "/". $file_arrayName[$i]);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
