php - CodeIgniter and S3 putObject - getting the right path to file
I am having trouble passing the correct URL of an image from CI to S3 servers.
My image is stored in the root folder under assets/image.jpg
$this->load->library('s3'); $this->s3->putObject('../../image.jpg', $bucket, 'testimage.jpg', 'public-read');
The bucket creates the file testimage.jpg however it is just a 20kb file that is corrupt.
Can someone let me know how to get the right path to the image?
I have already tried:
FCPATH . 'asset/image.jpg' and it did not work.
NOTE: I am doing this on my localhost, if that matters.
I have found the answer to the question and hopefully it can help someone else some time:
$this->s3->putObject(S3::inputFile('asset/image.jpg'), $bucket, 'testimage.jpg', 'public-read');
It was required to put