I want to upload large files to S3 through REST API using PHP server for creating signed URLs. In PHP S3 Client, there's a command "listParts" which return an array of multipart uploads and I use them in "completeMultipartUpload" to join all the multipart. Every part of the code is working fine, except "listParts". It returns null sometimes. So the function "completeMultipartUpload" does not executes. I can't figure out the reason why it's returning null sometimes. Here sometimes means when I upload a file, it works well. When I refresh the webpage and re-upload the same file it returns null. Then again refresh and upload, it works.
$partsModel = $client->listParts(array(
'Bucket' => bucket(),
'Key' => $_REQUEST['sendBackData']['key'],
'UploadId' => $_REQUEST['sendBackData']['uploadId'],
));