php - Prevent request timing out - large POST data -
in ios app, post new question, make http post request http://api.mysite.com/questions. post data larger or smaller depending on whether image attached question or not. small (sized around 100-200kb) images posted server without problem. however, larger photos (~1mb), device's camera cause request time out due large size of image.
please can tell me how can make sure image uploaded without problem, doesn't seem happen many other apps.
is problem server or ios code itself?
edit----
on server, once request has been received, php writes image data file. blob image data:
$filepath = $this->debug == true ? "../cityw/img/questions/{$qid}/attachment.png" :"../i/questions/$qid/attachment.png"; if (!file_exists($this->debug == true ? "../cityw/img/questions/{$qid}" : "../i/questions/{$qid}")) { mkdir($this->debug == true ? "../cityw/img/questions/{$qid}" : "../i/questions/{$qid}"); } $fh = fopen($filepath, 'w'); fwrite($fh, $blob); fclose($fh);
the image data sent server in base64, , decoded once has reached server.
have tried fixing problem set_time_limit
glad worked out you.
Comments
Post a Comment