Lives in the _content_type attribute of the model.
public contentType ( ) : string | ||
리턴 | string |
/** * Move an uploaded file to it's intended destination. * * @param string $file * @param string $filePath */ public function move($file, $filePath) { $objectConfig = $this->attachedFile->s3_object_config; $fileSpecificConfig = ['Key' => $filePath, 'SourceFile' => $file, 'ContentType' => $this->attachedFile->contentType()]; $mergedConfig = array_merge($objectConfig, $fileSpecificConfig); $this->ensureBucketExists($mergedConfig['Bucket']); $this->s3Client->putObject($mergedConfig); }
/** * Move an uploaded file to it's intended destination. * The file can be an actual uploaded file object or the path to * a resized image file on disk. * * @param UploadedFile $file * @param string $filePath * @return void */ public function move($file, $filePath) { $this->getS3Client()->putObject(['Bucket' => $this->getBucket(), 'Key' => $filePath, 'SourceFile' => $file, 'ContentType' => $this->attachedFile->contentType(), 'ACL' => $this->attachedFile->ACL]); }