diff --git a/api/application/libraries/AWS_S3.php b/api/application/libraries/AWS_S3.php index 60e29706..b1a02ad4 100644 --- a/api/application/libraries/AWS_S3.php +++ b/api/application/libraries/AWS_S3.php @@ -110,6 +110,19 @@ class AWS_S3 } + + public function getS3SingleObj($bucket_name,$folder_name,$time = '+5 minutes') + { + //echo $time;die(); + $result = $this->S3->getObject([ + 'Bucket' => $bucket_name, + 'Key' => $folder_name + //'ResponseContentType' => 'image/png' + //'ResponseContentDisposition' => 'attachment; woodgrass1.jpg', + ]); + + return result; + } // Get List of objetcs as byte(Raw file). public function getAllObjectsInaBucket($bucket_name,$folder_name) { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 2cdd8a39..d131610a 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -221,7 +221,7 @@ class PD_Model extends SPARQ_Model { /* *Get All PD Related Documents as signed and expired URL's from S3 Buckets */ - public function getSignedPDDocsURL($pdid,$form_id = null,$company_id = null,$is_common_api = null,$rental_count_id = null) + public function getSignedPDDocsURL($pdid,$form_id = null,$company_id = null,$is_common_api = null,$rental_count_id = null,$api_client = '') { //echo $pdid,$form_id,$company_id;die(); $document_lists = array(); @@ -266,7 +266,7 @@ class PD_Model extends SPARQ_Model { { $profilepics3path = 'pd'.$pdid.'/'.$value['pd_document_name']; - $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'+30 minutes'); + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'+2 day'); $document_lists[$key]['doc_url'] = $singed_uri; }