/**
  * Upload photo to s3 asynchronously, send result to $callback
  *
  * @param SplFileInfo $fileInfo
  * @param string $contentType
  * @param $callback
  * @param string|null $fileName
  */
 public function uploadPhotoAsync(SplFileInfo $fileInfo, $contentType, $callback, $fileName = null)
 {
     $this->s3->putObjectAsync($this->getUploadOptions($fileInfo, $contentType, $fileName))->then($callback);
 }
Beispiel #2
0
 /**
  * @internal
  * @param string $source
  * @param string $destination
  * @return Promise\Promise
  */
 public function s3Upload($source, $destination)
 {
     return $this->s3Client->putObjectAsync(['Bucket' => $this->basePath, 'Key' => Utils::normalizePath($this->relativePath . '/' . $destination), 'SourceFile' => $source, 'ACL' => 'public-read', 'StorageClass' => 'REDUCED_REDUNDANCY']);
 }